Documentation ¶
Index ¶
- type DownloadProgress
- type Entry
- type InfoOutput
- type Playlist
- type Wrapper
- func (wrapper *Wrapper) Download(ctx context.Context, url string, args ...string) ([]byte, error)
- func (wrapper *Wrapper) DownloadWithProgress(ctx context.Context, callback func(*DownloadProgress), url string, ...) error
- func (wrapper *Wrapper) Info(ctx context.Context, url string) (*InfoOutput, error)
- func (wrapper *Wrapper) Update(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadProgress ¶ added in v0.0.3
type Entry ¶
type Entry struct { ID string `json:"id"` Title string `json:"title"` UploadDate string `json:"upload_date"` UploaderID string `json:"uploader_id"` ChannelID string `json:"channel_id"` Description string `json:"description"` Extractor string `json:"extractor"` WebpageURL string `json:"webpage_url"` // sometimes not set // these are set for "URL"-type objects, returned from --flat-playlist RawURL string `json:"url"` IEKey string `json:"ie_key"` }
An Entry is a single video
type InfoOutput ¶
InfoOutput represents the JSON returned by `youtube-dl -J`. It changes format depending on if the target is a video or an entire playlist, which is why the struct looks like this:
func (*InfoOutput) GetAllEntries ¶
func (infoOutput *InfoOutput) GetAllEntries() []Entry
GetAllEntries returns an array of all entries, even if InfoOutput is just for a single video.
type Playlist ¶
type Playlist struct { ID string `json:"id"` Extractor string `json:"extractor"` Entries []Entry `json:"entries"` }
A Playlist is a list of entries
type Wrapper ¶
type Wrapper struct {
BinPath string
}
A Wrapper for the youtube-dl binary
func (*Wrapper) DownloadWithProgress ¶ added in v0.0.3
func (wrapper *Wrapper) DownloadWithProgress(ctx context.Context, callback func(*DownloadProgress), url string, args ...string) error
DownloadWithProgress downloads the given URL using youtube-dl and provides progress updates
Click to show internal directories.
Click to hide internal directories.