Documentation ¶
Index ¶
Constants ¶
const ( MediaAudio mediaType = iota MediaVideo MediaUnknown )
Variables ¶
This section is empty.
Functions ¶
func RSSFromYDLSInfo ¶
Types ¶
type Config ¶
type Config struct { InputFlags []string OutputFlags []string GoutubeDL GoutubeDLOptions CodecMap map[string]string Formats Formats DownloadRetries int }
YDLS config
type DownloadOptions ¶
type DownloadOptions struct { RequestOptions RequestOptions BaseURL *url.URL DebugLog Printer HTTPClient *http.Client Retries int }
DownloadOptions dowload options
type DownloadResult ¶
type DownloadResult struct { Media io.ReadCloser Filename string MIMEType string // contains filtered or unexported fields }
DownloadResult download result
type Format ¶
type Format struct { Name string Formats stringprioset.Set FormatFlags []string Streams []Stream SubtitleCodecs stringprioset.Set Ext string Prepend string MIMEType string // used by rss feeds etc EnclosureFormat string EnclosureFormatOptions []string EnclosureRequestOptions RequestOptions `json:"-"` }
Format media container format, possible codecs, extension and mime
func (*Format) UnmarshalJSON ¶
type Formats ¶
Formats map name to Format
func (Formats) FindByFormatCodecs ¶
FindByFormatCodecs find format by format and codecs prioritize formats with less codecs (more specific) return format and format name, format name is empty if not found
func (Formats) FindByName ¶
FindByName find format by name
func (*Formats) UnmarshalJSON ¶
type GoutubeDLOptions ¶
type GoutubeDLOptions struct {
Downloader string
}
type Printer ¶
type Printer interface { Print(v ...interface{}) Printf(format string, v ...interface{}) }
Printer used for log and debug
type RequestOptions ¶
type RequestOptions struct { MediaRawURL string // youtubedl media URL Format *Format // output format Codecs []string // force codecs Retranscode bool // force retranscode even if same input codec TimeRange timerange.TimeRange // time range limit Items uint // feed item count limit }
RequestOptions request options
func NewRequestOptionsFromOpts ¶
func NewRequestOptionsFromOpts(opts []string, formats Formats) (RequestOptions, error)
func NewRequestOptionsFromPath ¶
func NewRequestOptionsFromPath(url *url.URL, formats Formats) (RequestOptions, error)
NewRequestOptionsFromPath /format+opt+opt.../schema://host.domin/path?query /format+opt+opt.../host.domain/path?query /schema://host.domain/path?query /host.domain/path?query
func NewRequestOptionsFromQuery ¶
func NewRequestOptionsFromQuery(v url.Values, formats Formats) (RequestOptions, error)
NewRequestOptionsFromQuery /?url=...&format=...
func (RequestOptions) QueryValues ¶
func (r RequestOptions) QueryValues() url.Values
type Stream ¶
type Stream struct { Required bool Specifier string Codecs []Codec Media mediaType `json:"-"` CodecNames stringprioset.Set `json:"-"` }
func (*Stream) UnmarshalJSON ¶
type YDLS ¶
type YDLS struct {
Config Config // parsed config
}
YDLS youtubedl downloader with some extras
func NewFromFile ¶
NewFromFile new YDLs using config file
func (*YDLS) Download ¶
func (ydls *YDLS) Download(ctx context.Context, options DownloadOptions) (DownloadResult, error)
Download downloads media from URL using context and makes sure output is in specified format