Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AvailableLanguage ¶
type AvailableLanguage struct { // Full name of the language translation, e.g. "English" Name string `json:"name"` // Code representation of the language's name, e.g. "en" Code string `json:"code"` }
AvailableLanguage holds the available translation data of transcripts provided by YouTube
func GetAvailableLanguages ¶
func GetAvailableLanguages(url string) ([]AvailableLanguage, error)
GetAvailableLanguages returns all valid transcript languages available for the specified url.
The returned language names (not codes) could be translated to the language in your location. I.e. if the process calling this function has a Spanish IP, the names of the available langugues are going to be in Spanish.
type TranscriptTextChunk ¶ added in v0.1.0
type Video ¶ added in v0.0.2
type Video struct { Metadata *VideoMetadata `json:"metadata"` Transcript []TranscriptTextChunk `json:"transcript"` }
func GetVideo ¶ added in v0.0.2
GetVideo returns the whole video data, including the transcript, in English.
An alias for `vcat.GetVideoWithLanguage(url, "en")`
func GetVideoWithLanguage ¶ added in v0.1.0
GetVideoWithLanguage returns the whole video data, including the transcript in a specified language. Do pass in the language code, not the name of the language. E.g. "en", not "English".
Make sure the provided language is supported by asserting it is available on the content. You can use `vcat.GetAvailableLanguages`.
type VideoMetadata ¶ added in v0.0.2
type VideoMetadata struct { VideoId string `json:"videoId"` Title string `json:"title"` LengthSeconds string `json:"lengthSeconds"` Keywords []string `json:"keywords"` ChannelId string `json:"channelId"` ShortDescription string `json:"shortDescription"` Thumbnail struct { Thumbnails []struct { Url string `json:"url"` Width int `json:"width"` Height int `json:"height"` } `json:"thumbnails"` } `json:"thumbnail"` ViewCount string `json:"viewCount"` Author string `json:"author"` IsPrivate bool `json:"isPrivate"` IsLiveContent bool `json:"isLiveContent"` }
VideoMetadata stores information related to the video, e.g. the title, or the thumbnails