Documentation
¶
Index ¶
- func FeedHistory(selectedVideo SearchResultItem)
- func GetLocalSubscribedChannels() ([]string, error)
- func GetLocalSubscribedChannelsVideos() (*[]SearchResultItem, error)
- func NewYouTubeAPI(clientID, clientSecret string) (chan *YouTubeAPI, error)
- func SaveHistory(history *[]SearchResultItem, filename string) error
- func SearchVideos(query string, subscription bool) (*[]SearchResultItem, error)
- type SearchChannelResult
- type SearchResultItem
- type VideoSnippet
- type VideoThumbnail
- type YouTubeAPI
- type YouTubeSearchResponse
- type YouTubeSubscriptionsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FeedHistory ¶
func FeedHistory(selectedVideo SearchResultItem)
func GetLocalSubscribedChannelsVideos ¶
func GetLocalSubscribedChannelsVideos() (*[]SearchResultItem, error)
func NewYouTubeAPI ¶
func NewYouTubeAPI(clientID, clientSecret string) (chan *YouTubeAPI, error)
NewYouTubeAPI initializes the YouTube API by handling the OAuth2 flow.
func SaveHistory ¶
func SaveHistory(history *[]SearchResultItem, filename string) error
func SearchVideos ¶
func SearchVideos(query string, subscription bool) (*[]SearchResultItem, error)
Types ¶
type SearchChannelResult ¶
type SearchChannelResult struct {
Author string `json:"author"`
AuthorUrl string `json:"authorUrl"`
}
Struct to parse the JSON response from the Invidious API
func GetAllChannelsInfo ¶
func GetAllChannelsInfo(channelIds []string) ([]SearchChannelResult, error)
Function to fetch author information for a list of channel IDs
func SearchAuthorInfo ¶
func SearchAuthorInfo(channelId string) (SearchChannelResult, error)
type SearchResultItem ¶
type SearchResultItem struct {
Type string `json:"type"`
Title string `json:"title"`
VideoID string `json:"videoId"`
Author string `json:"author"`
AuthorID string `json:"authorId"`
AuthorURL string `json:"authorUrl"`
VideoThumbnails []VideoThumbnail `json:"videoThumbnails"`
Description string `json:"description"`
ViewCount int64 `json:"viewCount"`
ViewCountText string `json:"viewCountText"`
Published int64 `json:"published"`
PublishedText string `json:"publishedText"`
LengthSeconds int32 `json:"lengthSeconds"`
ViewedDate int64 `json:"vieweddate"`
}
SearchResultItem represents a single search result
func GetWatchedVideos ¶
func GetWatchedVideos(filename string) ([]SearchResultItem, error)
func SearchVideoInfo ¶
func SearchVideoInfo(videoID string) (SearchResultItem, error)
func YoutubeResultMenu ¶
func YoutubeResultMenu(videoData []SearchResultItem) (SearchResultItem, error)
Handles the interactive menu for video selection. Powered by fzf-like
type VideoSnippet ¶
type VideoThumbnail ¶
type YouTubeAPI ¶
func (*YouTubeAPI) GetAllSubscribedChannelsVideos ¶
func (yt *YouTubeAPI) GetAllSubscribedChannelsVideos() (*[]SearchResultItem, error)
func (*YouTubeAPI) GetSubscribedChannels ¶
func (yt *YouTubeAPI) GetSubscribedChannels() ([]string, error)
type YouTubeSearchResponse ¶
type YouTubeSearchResponse []SearchResultItem
YouTubeSearchResponse represents the response from a YouTube search
type YouTubeSubscriptionsResponse ¶
type YouTubeSubscriptionsResponse struct {
Items []struct {
Snippet struct {
ResourceId struct {
ChannelId string `json:"channelId"`
} `json:"resourceId"`
} `json:"snippet"`
} `json:"items"`
}
Click to show internal directories.
Click to hide internal directories.