Documentation ¶
Index ¶
- Constants
- func AddSubscription(id string) error
- func AddVideoToPlaylist(plid, videoID string) error
- func CheckLiveURL(uri string, audio bool) (string, bool)
- func CreatePlaylist(title, privacy string) error
- func DownloadParams(ctx context.Context, id, itag, filename string) (*http.Response, *os.File, error)
- func EditPlaylist(id, title, description, privacy string) error
- func GeneratePlaylist(file string, list []VideoData, flags int, appendToFile bool) (string, int, error)
- func PlaylistVideos(ctx context.Context, id string, auth bool, add func(stats [3]int64)) (PlaylistData, []VideoData, error)
- func RemovePlaylist(id string) error
- func RemoveSubscription(id string) error
- func RemoveVideoFromPlaylist(plid, index string) error
- func VideoThumbnail(ctx context.Context, id, image string) (*http.Response, error)
- type ChannelData
- type CommentData
- type CommentReply
- type CommentsData
- type FeedData
- type FeedVideos
- type PlaylistData
- type PlaylistVideo
- type SearchData
- type SubscriptionData
- type SuggestData
- type VideoData
- type VideoFormat
- type VideoThumbnails
Constants ¶
const PlaylistEntryPrefix = "invidtui.video."
Variables ¶
This section is empty.
Functions ¶
func AddSubscription ¶
AddSubscription adds a channel to the user's subscriptions.
func AddVideoToPlaylist ¶
AddVideoToPlaylist adds a video to the user's playlist.
func CheckLiveURL ¶
CheckLiveURL returns whether the provided live video's URL has expired or not.
func CreatePlaylist ¶
CreatePlaylist creates a playlist for the user.
func DownloadParams ¶
func DownloadParams(ctx context.Context, id, itag, filename string) (*http.Response, *os.File, error)
DownloadParams returns parameters that are used to download a file.
func EditPlaylist ¶
EditPlaylist edits a user's playlist properties.
func GeneratePlaylist ¶ added in v0.3.6
func GeneratePlaylist(file string, list []VideoData, flags int, appendToFile bool) (string, int, error)
GeneratePlaylist generates a playlist file.
func PlaylistVideos ¶ added in v0.3.7
func PlaylistVideos(ctx context.Context, id string, auth bool, add func(stats [3]int64)) (PlaylistData, []VideoData, error)
PlaylistVideos retrieves a playlist's videos only.
func RemovePlaylist ¶
RemovePlaylist removes a user's playlist.
func RemoveSubscription ¶
RemoveSubscription removes a user's subscription.
func RemoveVideoFromPlaylist ¶
RemoveVideoFromPlaylist removes a video from the user's playlist.
Types ¶
type ChannelData ¶
type ChannelData struct { Title string `json:"title"` ChannelID string `json:"authorId"` Author string `json:"author"` Description string `json:"description"` ViewCount int64 `json:"viewCount"` Continuation string `json:"continuation"` Videos []PlaylistVideo `json:"videos"` Playlists []PlaylistData `json:"playlists"` }
ChannelData stores channel related data.
func Channel ¶
func Channel(id, stype, continuation string, channel ...ChannelData) (ChannelData, error)
Channel retrieves information about a channel.
func ChannelPlaylists ¶
func ChannelPlaylists(id, continuation string) (ChannelData, error)
ChannelPlaylists loads only the playlists present in the channel.
func ChannelReleases ¶ added in v0.3.8
func ChannelReleases(id, continuation string) (ChannelData, error)
ChannelReleases loads only the releases present in the channel.
func ChannelVideos ¶
func ChannelVideos(id, continuation string) (ChannelData, error)
ChannelVideos retrieves video information from a channel.
type CommentData ¶
type CommentData struct { Verified bool `json:"verified"` Author string `json:"author"` AuthorID string `json:"authorId"` AuthorURL string `json:"authorUrl"` Content string `json:"content"` PublishedText string `json:"publishedText"` LikeCount int `json:"likeCount"` CommentID string `json:"commentId"` AuthorIsChannelOwner bool `json:"authorIsChannelOwner"` Replies CommentReply `json:"replies"` }
CommentData stores information about a comment.
type CommentReply ¶
type CommentReply struct { ReplyCount int `json:"replyCount"` Continuation string `json:"continuation"` }
CommentReply stores information about comment replies.
type CommentsData ¶
type CommentsData struct { Comments []CommentData `json:"comments"` Continuation string `json:"continuation"` }
CommentsData stores comments and its continuation data.
type FeedData ¶
type FeedData struct {
Videos []FeedVideos `json:"videos"`
}
FeedData stores videos in the user's feed.
type FeedVideos ¶
type FeedVideos struct { Type string `json:"type"` Title string `json:"title"` VideoID string `json:"videoId"` LengthSeconds int64 `json:"lengthSeconds"` Author string `json:"author"` AuthorID string `json:"authorId"` AuthorURL string `json:"authorUrl"` PublishedText string `json:"publishedText"` ViewCount int64 `json:"viewCount"` }
FeedVideos stores information about a video in the user's feed.
type PlaylistData ¶
type PlaylistData struct { Title string `json:"title"` PlaylistID string `json:"playlistId"` Author string `json:"author"` AuthorID string `json:"authorId"` Description string `json:"description"` VideoCount int64 `json:"videoCount"` ViewCount int64 `json:"viewCount"` Videos []PlaylistVideo `json:"videos"` }
PlaylistData stores information about a playlist.
func UserPlaylists ¶
func UserPlaylists() ([]PlaylistData, error)
UserPlaylists retrieves the user's playlists.
type PlaylistVideo ¶
type PlaylistVideo struct { Title string `json:"title"` Author string `json:"author"` Index int32 `json:"index"` IndexID string `json:"indexId"` VideoID string `json:"videoId"` AuthorID string `json:"authorId"` LengthSeconds int64 `json:"lengthSeconds"` }
PlaylistVideo stores information about a video in the playlist.
type SearchData ¶
type SearchData struct { Type string `json:"type"` Title string `json:"title"` AuthorID string `json:"authorId"` VideoID string `json:"videoId"` PlaylistID string `json:"playlistId"` Author string `json:"author"` IndexID string `json:"indexId"` ViewCountText string `json:"viewCountText"` PublishedText string `json:"publishedText"` Duration string `json:"duration"` Description string `json:"description"` VideoCount int64 `json:"videoCount"` SubCount int `json:"subCount"` LengthSeconds int64 `json:"lengthSeconds"` LiveNow bool `json:"liveNow"` Timestamp *int64 }
SearchData stores information about a search result.
func ChannelSearch ¶
func ChannelSearch(id, searchText string, page int) ([]SearchData, int, error)
ChannelSearch searches for a query string in the channel.
func GetSearchData ¶ added in v0.4.3
func GetSearchData(info interface{}, d ...SearchData) SearchData
GetSearchData returns the SearchData according to the provided info.
type SubscriptionData ¶
SubscriptionData stores information about the user's subscriptions.
func Subscriptions ¶
func Subscriptions() (SubscriptionData, error)
Subscriptions retrieves the user's subscriptions.
type SuggestData ¶
SuggestData stores search suggestions.
func SearchSuggestions ¶
func SearchSuggestions(text string) (SuggestData, error)
SearchSuggestions retrieves search suggestions.
type VideoData ¶
type VideoData struct { Title string `json:"title"` Author string `json:"author"` AuthorID string `json:"authorId"` VideoID string `json:"videoId"` HlsURL string `json:"hlsUrl"` LengthSeconds int64 `json:"lengthSeconds"` LiveNow bool `json:"liveNow"` ViewCount int `json:"viewCount"` LikeCount int `json:"likeCount"` PublishedText string `json:"publishedText"` SubCountText string `json:"subCountText"` Description string `json:"description"` Thumbnails []VideoThumbnails `json:"videoThumbnails"` FormatStreams []VideoFormat `json:"formatStreams"` AdaptiveFormats []VideoFormat `json:"adaptiveFormats"` RecommendedVideos []VideoData `json:"recommendedVideos"` MediaType string Timestamp *int64 }
VideoData stores information about a video.
type VideoFormat ¶
type VideoFormat struct { Type string `json:"type"` URL string `json:"url"` Itag string `json:"itag"` Container string `json:"container"` Encoding string `json:"encoding"` Resolution string `json:"resolution,omitempty"` Bitrate int64 `json:"bitrate,string"` ContentLength int64 `json:"clen,string"` FPS int `json:"fps"` AudioSampleRate int `json:"audioSampleRate"` AudioChannels int `json:"audioChannels"` }
VideoFormat stores information about the video's format.