Documentation
¶
Index ¶
- func Version() string
- type AddVideoRequest
- type AddVideoResponse
- type AuthorizeTokenRequest
- type ChannelObject
- type ChannelResponse
- type Client
- func (c *Client) AddSubscription(ucid string) error
- func (c *Client) AddToHistory(id string) error
- func (c *Client) AddVideo(req AddVideoRequest) (*AddVideoResponse, error)
- func (c *Client) AuthorizeToken(req AuthorizeTokenRequest) (err error)
- func (c *Client) Channel(id string) (*ChannelResponse, error)
- func (c *Client) CreatePlaylist(req CreatePlaylistRequest) (*CreatePlaylistResponse, error)
- func (c *Client) DeleteFromHistory(id string) error
- func (c *Client) DeletePlaylist(id string) error
- func (c *Client) DeleteVideo(req DeleteVideoRequest) error
- func (c *Client) Feed(req FeedRequest) (*FeedResponse, error)
- func (c *Client) History(req HistoryRequest) (HistoryResponse, error)
- func (c *Client) Playlist(id string) (*PlaylistResponse, error)
- func (c *Client) Playlists() (PlaylistsResponse, error)
- func (c *Client) Preferences() (*PreferencesResponse, error)
- func (c *Client) RegisterToken(req RegisterTokenRequest) (*Token, error)
- func (c *Client) RemoveSubscription(ucid string) error
- func (c *Client) RevokeToken(req RevokeRequest) error
- func (c *Client) Stats() (*StatsResponse, error)
- func (c *Client) Subscriptions() (SubscriptionsResponse, error)
- func (c *Client) Tokens() (TokensResponse, error)
- func (c *Client) UpdatePlaylist(req UpdatePlaylistRequest) error
- func (c *Client) Video(req VideoRequest) (*VideoResponse, error)
- type CreatePlaylistRequest
- type CreatePlaylistResponse
- type DeleteVideoRequest
- type Error
- type FeedRequest
- type FeedResponse
- type HistoryRequest
- type HistoryResponse
- type ImageObject
- type PlaylistObject
- type PlaylistResponse
- type PlaylistsResponse
- type PreferencesResponse
- type Privacy
- type RegisterTokenRequest
- type RevokeRequest
- type StatsResponse
- type SubscriptionsResponse
- type ThumbnailObject
- type Token
- type TokensResponse
- type UpdatePlaylistRequest
- type VideoObject
- type VideoRequest
- type VideoResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddVideoRequest ¶
type AddVideoResponse ¶
type AddVideoResponse struct {
Title string `json:"title"`
VideoId string `json:"videoId"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"videoThumbnails"`
}
type AuthorizeTokenRequest ¶ added in v0.1.1
type ChannelObject ¶ added in v0.1.2
type ChannelObject struct {
Type string `json:"type"` // "channel"
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
AuthorVerified bool `json:"authorVerified"`
AuthorThumbnails []ThumbnailObject `json:"authorThumbnails"`
AutoGenerated bool `json:"autoGenerated"`
SubCount int64 `json:"subCount"`
VideoCount int64 `json:"videoCount"`
Description string `json:"description"`
DescriptionHtml string `json:"descriptionHtml"`
}
type ChannelResponse ¶ added in v0.1.2
type ChannelResponse struct {
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
AuthorVerified bool `json:"authorVerified"`
AuthorBanners []ImageObject `json:"authorBanners"`
AuthorThumbnails []ImageObject `json:"authorThumbnails"`
SubCount int64 `json:"subCount"`
TotalViews int64 `json:"totalViews"`
Joined time.Time `json:"joined"`
AutoGenerated bool `json:"autoGenerated"`
IsFamilyFriendly bool `json:"isFamilyFriendly"`
Description string `json:"description"`
DescriptionHtml string `json:"descriptionHtml"`
AllowedRegions []string `json:"allowedRegions"`
Tabs []string `json:"tabs"`
LatestVideos []VideoObject `json:"latestVideos"`
RelatedChannels []ChannelObject `json:"relatedChannels"`
}
type Client ¶
func (*Client) AddSubscription ¶
func (*Client) AddToHistory ¶
func (*Client) AddVideo ¶
func (c *Client) AddVideo(req AddVideoRequest) (*AddVideoResponse, error)
func (*Client) AuthorizeToken ¶
func (c *Client) AuthorizeToken(req AuthorizeTokenRequest) (err error)
func (*Client) Channel ¶ added in v0.1.2
func (c *Client) Channel(id string) (*ChannelResponse, error)
func (*Client) CreatePlaylist ¶
func (c *Client) CreatePlaylist(req CreatePlaylistRequest) (*CreatePlaylistResponse, error)
func (*Client) DeleteFromHistory ¶
func (*Client) DeletePlaylist ¶
func (*Client) DeleteVideo ¶
func (c *Client) DeleteVideo(req DeleteVideoRequest) error
func (*Client) Feed ¶
func (c *Client) Feed(req FeedRequest) (*FeedResponse, error)
func (*Client) History ¶
func (c *Client) History(req HistoryRequest) (HistoryResponse, error)
func (*Client) Playlists ¶
func (c *Client) Playlists() (PlaylistsResponse, error)
func (*Client) Preferences ¶
func (c *Client) Preferences() (*PreferencesResponse, error)
func (*Client) RegisterToken ¶
func (c *Client) RegisterToken(req RegisterTokenRequest) (*Token, error)
func (*Client) RemoveSubscription ¶
func (*Client) RevokeToken ¶
func (c *Client) RevokeToken(req RevokeRequest) error
func (*Client) Stats ¶
func (c *Client) Stats() (*StatsResponse, error)
func (*Client) Subscriptions ¶
func (c *Client) Subscriptions() (SubscriptionsResponse, error)
func (*Client) Tokens ¶
func (c *Client) Tokens() (TokensResponse, error)
func (*Client) UpdatePlaylist ¶
func (c *Client) UpdatePlaylist(req UpdatePlaylistRequest) error
func (*Client) Video ¶ added in v0.1.2
func (c *Client) Video(req VideoRequest) (*VideoResponse, error)
type CreatePlaylistRequest ¶
type CreatePlaylistResponse ¶
type DeleteVideoRequest ¶
type FeedRequest ¶
type FeedResponse ¶
type FeedResponse struct {
Notifications []struct {
Type string `json:"type"` // "shortVideo"
Title string `json:"title"`
VideoId string `json:"videoId"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int64 `json:"width"`
Height int64 `json:"height"`
} `json:"videoThumbnails"`
LengthSeconds int64 `json:"lengthSeconds"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
Published int64 `json:"published"`
PublishedText string `json:"publishedText"`
ViewCount int64 `json:"viewCount"`
} `json:"notifications"`
Videos []struct {
Type string `json:"type"` // "shortVideo"
Title string `json:"title"`
VideoId string `json:"videoId"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int64 `json:"width"`
Height int64 `json:"height"`
} `json:"videoThumbnails"`
LengthSeconds int64 `json:"lengthSeconds"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
Published int64 `json:"published"`
PublishedText string `json:"publishedText"`
ViewCount int64 `json:"viewCount"`
} `json:"videos"`
}
type HistoryRequest ¶
type HistoryResponse ¶
type HistoryResponse []string
type ImageObject ¶ added in v0.1.2
type PlaylistObject ¶ added in v0.1.2
type PlaylistObject struct {
Type string `json:"type"` // "playlist"
Title string `json:"title"`
PlaylistId string `json:"playlistId"`
PlaylistThumbnail string `json:"playlistThumbnail"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
AuthorVerified bool `json:"authorVerified"`
VideoCount int64 `json:"videoCount"`
Videos []struct {
Title string `json:"title"`
VideoId string `json:"videoId"`
LengthSeconds int64 `json:"lengthSeconds"`
VideoThumbnails []ThumbnailObject `json:"videoThumbnails"`
} `json:"videos"`
}
type PlaylistResponse ¶
type PlaylistResponse struct {
Title string `json:"title"`
PlaylistId string `json:"playlistId"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorThumbnails []struct {
Url string `json:"url"`
Width string `json:"width"`
Height string `json:"height"`
} `json:"authorThumbnails"`
Description string `json:"description"`
DescriptionHtml string `json:"descriptionHtml"`
VideoCount int32 `json:"videoCount"`
ViewCount int64 `json:"viewCount"`
ViewCountText string `json:"viewCountText"`
Updated int64 `json:"updated"`
Videos []struct {
Title string `json:"title"`
VideoId string `json:"videoId"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"videoThumbnails"`
Index int32 `json:"index"`
IndexId string `json:"indexId"`
LengthSeconds int32 `json:"lengthSeconds"`
} `json:"videos"`
}
type PlaylistsResponse ¶
type PlaylistsResponse []struct {
Type string `json:"type"` // "invidiousPlaylist"
Title string `json:"title"`
PlaylistId string `json:"playlistId"`
Author string `json:"author"`
AuthorId any `json:"authorId"`
AuthorUrl any `json:"authorUrl"`
AuthorThumbnails []any `json:"authorThumbnails"`
Description string `json:"description"`
DescriptionHtml string `json:"descriptionHtml"`
VideoCount int32 `json:"videoCount"`
ViewCount int64 `json:"viewCount"`
Updated int64 `json:"updated"`
IsListed bool `json:"isListed"`
Videos []struct {
Title string `json:"title"`
VideoId string `json:"videoId"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"videoThumbnails"`
Index int32 `json:"index"`
IndexId string `json:"indexId"`
LengthSeconds int32 `json:"lengthSeconds"`
} `json:"videos"`
}
type PreferencesResponse ¶
type PreferencesResponse struct {
Annotations bool `json:"annotations"`
AnnotationsSubscribed bool `json:"annotations_subscribed"`
Autoplay bool `json:"autoplay"`
Captions []string `json:"captions"`
Comments []string `json:"comments"`
Continue bool `json:"continue"`
ContinueAutoplay bool `json:"continue_autoplay"`
DarkMode string `json:"dark_mode"`
LatestOnly bool `json:"latest_only"`
Listen bool `json:"listen"`
Local bool `json:"local"`
Locale string `json:"locale"`
MaxResults int32 `json:"max_results"`
NotificationsOnly bool `json:"notifications_only"`
PlayerStyle string `json:"player_style"`
Quality string `json:"quality"`
DefaultHome string `json:"default_home"`
FeedMenu []string `json:"feed_menu"`
RelatedVideos bool `json:"related_videos"`
Sort string `json:"sort"`
Speed float64 `json:"speed"`
ThinMode bool `json:"thin_mode"`
UnseenOnly bool `json:"unseen_only"`
VideoLoop bool `json:"video_loop"`
Volume uint8 `json:"volume"`
}
type RegisterTokenRequest ¶
type RevokeRequest ¶
type RevokeRequest struct {
Session string `json:"session"`
}
type StatsResponse ¶
type StatsResponse struct {
Version string `json:"version"`
Software struct {
Name string `json:"name"` // "invidious"
Version string `json:"version"`
Branch string `json:"branch"`
} `json:"software"`
OpenRegistrations bool `json:"openRegistrations"`
Usage struct {
Users struct {
Total int32 `json:"total"`
ActiveHalfyear int32 `json:"activeHalfyear"`
ActiveMonth int32 `json:"activeMonth"`
} `json:"users"`
} `json:"usage"`
Metadata struct {
UpdatedAt int64 `json:"updatedAt"`
LastChannelRefreshedAt int64 `json:"lastChannelRefreshedAt"`
} `json:"metadata"`
Playback struct {
TotalRequests option.Option[int32] `json:"totalRequests"`
SuccessfulRequests option.Option[int32] `json:"successfulRequests"`
Ratio option.Option[float32] `json:"ratio"`
} `json:"playback"`
}
type SubscriptionsResponse ¶
type ThumbnailObject ¶ added in v0.1.2
type Token ¶
type Token struct {
Session string `json:"session"`
Scopes []string `json:"scopes"`
Expire time.Time `json:"expire"`
Signature string `json:"signature"`
}
func ParseToken ¶
type TokensResponse ¶
type UpdatePlaylistRequest ¶
type VideoObject ¶ added in v0.1.2
type VideoObject struct {
Type string `json:"type"` // "video"
Title string `json:"title"`
VideoId string `json:"videoId"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
AuthorVerified bool `json:"authorVerified"`
VideoThumbnails []ThumbnailObject `json:"videoThumbnails"`
Description string `json:"description"`
DescriptionHtml string `json:"descriptionHtml"`
ViewCount int64 `json:"viewCount"`
ViewCountText string `json:"viewCountText"`
LengthSeconds int64 `json:"lengthSeconds"`
Published time.Time `json:"published"`
PublishedText string `json:"publishedText"`
// Only available on premiered videos
PremiereTimestamp time.Time `json:"premiereTimestamp"`
LiveNow bool `json:"liveNow"`
Premium bool `json:"premium"`
IsUpcoming bool `json:"isUpcoming"`
IsNew bool `json:"isNew"`
Is4k bool `json:"is4K"`
Is8k bool `json:"is8K"`
IsVr180 bool `json:"isVr180"`
IsVr360 bool `json:"isVr360"`
Is3d bool `json:"is3D"`
HasCaptions bool `json:"hasCaptions"`
}
type VideoRequest ¶ added in v0.1.2
type VideoResponse ¶ added in v0.1.2
type VideoResponse struct {
Type string `json:"type"` // "video"|"published"
Title string `json:"title"`
VideoId string `json:"videoId"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"videoThumbnails"`
Storyboards []struct {
Url string `json:"url"`
TemplateUrl string `json:"templateUrl"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Count int32 `json:"count"`
Interval int32 `json:"interval"`
StoryboardWidth int32 `json:"storyboardWidth"`
StoryboardHeight int32 `json:"storyboardHeight"`
StoryboardCount int32 `json:"storyboardCount"`
} `json:"storyboards"`
Description string `json:"description"`
DescriptionHtml string `json:"descriptionHtml"`
Published int64 `json:"published"`
PublishedText string `json:"publishedText"`
Keywords []string `json:"keywords"`
ViewCount int64 `json:"viewCount"`
LikeCount int32 `json:"likeCount"`
DislikeCount int32 `json:"dislikeCount"`
Paid bool `json:"paid"`
Premium bool `json:"premium"`
IsFamilyFriendly bool `json:"isFamilyFriendly"`
AllowedRegions []string `json:"allowedRegions"`
Genre string `json:"genre"`
GenreUrl string `json:"genreUrl"`
Author string `json:"author"`
AuthorId string `json:"authorId"`
AuthorUrl string `json:"authorUrl"`
AuthorThumbnails []struct {
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"authorThumbnails"`
SubCountText string `json:"subCountText"`
LengthSeconds int32 `json:"lengthSeconds"`
AllowRatings bool `json:"allowRatings"`
Rating float32 `json:"rating"`
IsListed bool `json:"isListed"`
LiveNow bool `json:"liveNow"`
IsPostLiveDvr bool `json:"isPostLiveDvr"`
IsUpcoming bool `json:"isUpcoming"`
DashUr string `json:"dashUr"`
PremiereTimestamp option.Option[int64] `json:"premiereTimestamp"`
HlsUrl option.Option[string] `json:"hlsUrl"`
AdaptiveFormats []struct {
Index string `json:"index"`
Bitrate string `json:"bitrate"`
Init string `json:"init"`
Url string `json:"url"`
Itag string `json:"itag"`
Type string `json:"type"`
Clen string `json:"clen"`
Lmt string `json:"lmt"`
ProjectionType string `json:"projectionType"`
Container string `json:"container"`
Encoding string `json:"encoding"`
QualityLabel option.Option[string] `json:"qualityLabel"`
Resolution option.Option[string] `json:"resolution"`
Fps int32 `json:"fps"`
Size option.Option[string] `json:"size"`
TargetDurationsec option.Option[int64] `json:"targetDurationsec"`
MaxDvrDurationSec option.Option[int64] `json:"maxDvrDurationSec"`
AudioQuality option.Option[string] `json:"audioQuality"`
AudioSampleRate option.Option[string] `json:"audioSampleRate"`
AudioChannels option.Option[string] `json:"audioChannels"`
ColorInfo option.Option[string] `json:"colorInfo"`
CaptionTrack option.Option[string] `json:"captionTrack"`
} `json:"adaptiveFormats"`
FormatStreams []struct {
Url string `json:"url"`
Itag string `json:"itag"`
Type string `json:"type"`
Quality string `json:"quality"`
Bitrate option.Option[string] `json:"bitrate"`
Container string `json:"container"`
Encoding string `json:"encoding"`
QualityLabel string `json:"qualityLabel"`
Resolution string `json:"resolution"`
Size string `json:"size"`
} `json:"formatStreams"`
Captions []struct {
Label string `json:"label"`
Language_code string `json:"language_Code"`
Url string `json:"url"`
} `json:"captions"`
MusicTracks []struct {
Song string `json:"song"`
Artist string `json:"artist"`
Album string `json:"album"`
License string `json:"license"`
} `json:"musicTracks"`
RecommendedVideos []struct {
VideoId string `json:"videoId"`
Title string `json:"title"`
VideoThumbnails []struct {
Quality string `json:"quality"`
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"videoThumbnails"`
Author string `json:"author"`
AuthorUrl string `json:"authorUrl"`
AuthorId option.Option[string] `json:"authorId"`
AuthorVerified bool `json:"authorVerified"`
AuthorThumbnails []struct {
Url string `json:"url"`
Width int32 `json:"width"`
Height int32 `json:"height"`
} `json:"authorThumbnails"`
LengthSeconds int32 `json:"lengthSeconds"`
ViewCount int64 `json:"viewCount"`
ViewCountText string `json:"viewCountText"`
} `json:"recommendedVideos"`
}
Click to show internal directories.
Click to hide internal directories.