Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
Manager is used to initialize a youtube object with needed config.
func (Manager) DownloadDCAAudio ¶
DownloadDCAAudio takes a youtube video id, downloads the audio and then converts the song to DCA format to be compatible with discordgo.
func (Manager) Search ¶
func (yt Manager) Search(searchStr string) (SearchListResponse, error)
Search takes a string input and searches youtube for results. Search returns a YoutubeSearchListResponse with the results.
func (Manager) SearchFirstResult ¶
func (yt Manager) SearchFirstResult(searchStr string) (SearchResult, error)
SearchFirstResult takes a string input and searches youtube, returning only the first result in a YoutubeSearchResult
type SearchListResponse ¶
type SearchListResponse struct { Kind string `json:"kind"` Etag string `json:"etag"` NextPageToken string `json:"nextPageToken"` PrevPageToken string `json:"prevPageToken"` RegionCode string `json:"regionCode"` PageInfo struct { TotalResults float64 `json:"totalResults"` ResultsPerPage float64 `json:"resutlsPerPage"` } `json:"pageInfo"` Items []SearchResult `json:"items"` }
SearchListResponse is used for json unmarshalling a Youtube search result
type SearchResult ¶
type SearchResult struct { Kind string `json:"kind"` Etag string `json:"etag"` ID struct { Kind string `json:"kind"` VideoID string `json:"videoId"` ChannelID string `json:"channelId"` PlaylistID string `json:"playlistId"` } `json:"id"` Snippet struct { PublishedAt string `json:"publishedAt"` ChannelID string `json:"channelId"` Title string `json:"title"` Description string `json:"description"` Thumbnails struct { Default thumbnailInfo `json:"default"` Medium thumbnailInfo `json:"medium"` High thumbnailInfo `json:"high"` } `json:"thumbnails"` ChannelTitle string `json:"channelTitle"` LiveBroadcastContent string `json:"liveBroadcastContent"` } `json:"snippet"` }
SearchResult is use for json unmarshalling a Youtube search result.
Click to show internal directories.
Click to hide internal directories.