Versions in this module Expand all Collapse all v2 v2.1.0 Jan 4, 2023 Changes in this version + const ErrCipherNotFound + const ErrInvalidCharactersInVideoID + const ErrInvalidPlaylist + const ErrLoginRequired + const ErrNotPlayableInEmbed + const ErrReadOnClosedResBody + const ErrSignatureTimestampNotFound + const ErrVideoIDMinLength + const ErrVideoPrivate + func ExtractVideoID(videoID string) (string, error) + type Client struct + Debug bool + HTTPClient *http.Client + func (c *Client) GetPlaylist(url string) (*Playlist, error) + func (c *Client) GetPlaylistContext(ctx context.Context, url string) (*Playlist, error) + func (c *Client) GetStream(video *Video, format *Format) (io.ReadCloser, int64, error) + func (c *Client) GetStreamContext(ctx context.Context, video *Video, format *Format) (io.ReadCloser, int64, error) + func (c *Client) GetStreamURL(video *Video, format *Format) (string, error) + func (c *Client) GetStreamURLContext(ctx context.Context, video *Video, format *Format) (string, error) + func (c *Client) GetVideo(url string) (*Video, error) + func (c *Client) GetVideoContext(ctx context.Context, url string) (*Video, error) + func (c *Client) VideoFromPlaylistEntry(entry *PlaylistEntry) (*Video, error) + func (c *Client) VideoFromPlaylistEntryContext(ctx context.Context, entry *PlaylistEntry) (*Video, error) + type DecipherOperation func([]byte) []byte + type ErrPlayabiltyStatus struct + Reason string + Status string + func (err ErrPlayabiltyStatus) Error() string + type ErrPlaylistStatus struct + Reason string + func (err ErrPlaylistStatus) Error() string + type ErrUnexpectedStatusCode int + func (err ErrUnexpectedStatusCode) Error() string + type Format struct + ApproxDurationMs string + AudioChannels int + AudioQuality string + AudioSampleRate string + AverageBitrate int + Bitrate int + Cipher string + ContentLength int64 + FPS int + Height int + IndexRange ... + InitRange ... + ItagNo int + LastModified string + MimeType string + ProjectionType string + Quality string + QualityLabel string + URL string + Width int + type FormatList []Format + func (list FormatList) AudioChannels(n int) (result FormatList) + func (list FormatList) FindByItag(itagNo int) *Format + func (list FormatList) FindByQuality(quality string) *Format + func (list FormatList) Quality(quality string) (result FormatList) + func (list FormatList) Sort() + func (list FormatList) Type(t string) (result FormatList) + func (list FormatList) WithAudioChannels() (result FormatList) + type Playlist struct + Author string + Description string + ID string + Title string + Videos []*PlaylistEntry + type PlaylistEntry struct + Author string + Duration time.Duration + ID string + Thumbnails Thumbnails + Title string + type Thumbnail struct + Height uint + URL string + Width uint + type Thumbnails []Thumbnail + type Video struct + Author string + ChannelID string + DASHManifestURL string + Description string + Duration time.Duration + Formats FormatList + HLSManifestURL string + ID string + PublishDate time.Time + Thumbnails Thumbnails + Title string + Views int + func (v *Video) FilterQuality(quality string) + func (v *Video) SortBitrateAsc(i int, j int) bool + func (v *Video) SortBitrateDesc(i int, j int) bool