youtube_urls

package
v0.1.56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
const (
	YoutubeHost = "youtube.com"

	DefaultVideoExt     = mp4Ext
	DefaultThumbnailExt = jpegExt
)
View Source
const (
	StatusOK = "OK"
)

Variables

View Source
var (
	ErrMissingRequiredNode = errors.New("missing required node")
)

Functions

func BrowseUrl

func BrowseUrl(path, apiKey string) *url.URL

func ChannelPlaylistsUrl added in v0.1.51

func ChannelPlaylistsUrl(channelId string) *url.URL

func ChannelUrl

func ChannelUrl(channelId string) *url.URL

func ChannelVideosUrl added in v0.1.50

func ChannelVideosUrl(channelId string) *url.URL

func PlayerUrl

func PlayerUrl(path string) *url.URL

func PlaylistId

func PlaylistId(ytUrlStr string) (string, error)

PlaylistId extracts playlist-id from a PlaylistUrl conforming URL

func PlaylistUrl

func PlaylistUrl(playlistId string) *url.URL

PlaylistUrl provides a URL for a playlist-id, e.g. http://www.youtube.com/playlist?list=playlist-id1 for "playlist-id1"

func SearchResultsUrl

func SearchResultsUrl(terms ...string) *url.URL

SearchResultsUrl provides a URL for a set of search terms, e.g. http://www.youtube.com/results?search_query=some+terms

func ThumbnailUrl

func ThumbnailUrl(videoId string, tq ThumbnailQuality) *url.URL

func ThumbnailUrls

func ThumbnailUrls(videoId string) []*url.URL

func VideoId

func VideoId(ytUrlStr string) (string, error)

VideoId extracts video-id from a VideoUrl conforming URL

func VideoUrl

func VideoUrl(videoId string) *url.URL

VideoUrl provides a URL for a video-id, e.g. http://www.youtube.com/watch?v=video-id1 for "video-id1"

Types

type CaptionTrack

type CaptionTrack struct {
	BaseUrl        string     `json:"baseUrl"`
	Name           SimpleText `json:"name"`
	VSSId          string     `json:"vssId"`
	LanguageCode   string     `json:"languageCode"`
	Kind           string     `json:"kind"`
	IsTranslatable bool       `json:"isTranslatable"`
	TrackName      string     `json:"trackName"`
}

type ChannelPlaylistsInitialData added in v0.1.53

type ChannelPlaylistsInitialData struct {
	Contents struct {
		TwoColumnBrowseResultsRenderer struct {
			Tabs []struct {
				TabRenderer struct {
					Title          string `json:"title"`
					TrackingParams string `json:"trackingParams"`
					Selected       bool   `json:"selected,omitempty"`
					Content        struct {
						SectionListRenderer struct {
							Contents []struct {
								ItemSectionRenderer struct {
									Contents []struct {
										GridRenderer struct {
											Items []struct {
												GridPlaylistRenderer GridPlaylistRenderer `json:"gridPlaylistRenderer"`
											} `json:"items"`
										} `json:"gridRenderer"`
									} `json:"contents"`
								} `json:"itemSectionRenderer"`
							} `json:"contents"`
						} `json:"sectionListRenderer"`
					} `json:"content,omitempty"`
				} `json:"tabRenderer,omitempty"`
			} `json:"tabs"`
		} `json:"twoColumnBrowseResultsRenderer"`
	} `json:"contents"`
	Metadata struct {
		ChannelMetadataRenderer struct {
			Title                 string   `json:"title"`
			Description           string   `json:"description"`
			RssUrl                string   `json:"rssUrl"`
			ChannelConversionUrl  string   `json:"channelConversionUrl"`
			ExternalId            string   `json:"externalId"`
			Keywords              string   `json:"keywords"`
			OwnerUrls             []string `json:"ownerUrls"`
			ChannelUrl            string   `json:"channelUrl"`
			IsFamilySafe          bool     `json:"isFamilySafe"`
			AvailableCountryCodes []string `json:"availableCountryCodes"`
			VanityChannelUrl      string   `json:"vanityChannelUrl"`
		} `json:"channelMetadataRenderer"`
	} `json:"metadata"`
	Context *ytCfgInnerTubeContext
}

func GetChannelPlaylistsPage added in v0.1.53

func GetChannelPlaylistsPage(client *http.Client, channelId string) (*ChannelPlaylistsInitialData, error)

func (*ChannelPlaylistsInitialData) Playlists added in v0.1.53

type ChannelRenderer

type ChannelRenderer struct {
	ChannelId           string             `json:"channelId"`
	Title               SimpleText         `json:"title"`
	NavigationEndpoint  NavigationEndpoint `json:"navigationEndpoint"`
	DescriptionSnippet  TextRuns           `json:"descriptionSnippet"`
	ShortBylineText     TextRuns           `json:"shortBylineText"`
	VideoCountText      SimpleText         `json:"videoCountText"`
	SubscriberCountText SimpleText         `json:"subscriberCountText"`
	LongBylineText      TextRuns           `json:"longBylineText"`
}

type ChannelVideosInitialData added in v0.1.51

type ChannelVideosInitialData struct {
	ResponseContext struct {
		ServiceTrackingParams []struct {
			Service string `json:"service"`
			Params  []struct {
				Key   string `json:"key"`
				Value string `json:"value"`
			} `json:"params"`
		} `json:"serviceTrackingParams"`
		MaxAgeSeconds             int `json:"maxAgeSeconds"`
		MainAppWebResponseContext struct {
			DatasyncId    string `json:"datasyncId"`
			LoggedOut     bool   `json:"loggedOut"`
			TrackingParam string `json:"trackingParam"`
		} `json:"mainAppWebResponseContext"`
		WebResponseContextExtensionData struct {
			YtConfigData struct {
				VisitorData           string `json:"visitorData"`
				SessionIndex          int    `json:"sessionIndex"`
				RootVisualElementType int    `json:"rootVisualElementType"`
			} `json:"ytConfigData"`
			HasDecorated bool `json:"hasDecorated"`
		} `json:"webResponseContextExtensionData"`
	} `json:"responseContext"`
	Contents struct {
		TwoColumnBrowseResultsRenderer struct {
			Tabs []struct {
				TabRenderer struct {
					Title    string `json:"title"`
					Selected bool   `json:"selected,omitempty"`
					Content  struct {
						RichGridRenderer struct {
							Contents []RichGridRendererContents `json:"contents"`
						} `json:"richGridRenderer"`
					} `json:"content,omitempty"`
				} `json:"tabRenderer,omitempty"`
			} `json:"tabs"`
		} `json:"twoColumnBrowseResultsRenderer"`
	} `json:"contents"`
	Metadata struct {
		ChannelMetadataRenderer struct {
			Title                 string   `json:"title"`
			Description           string   `json:"description"`
			RssUrl                string   `json:"rssUrl"`
			ChannelConversionUrl  string   `json:"channelConversionUrl"`
			ExternalId            string   `json:"externalId"`
			Keywords              string   `json:"keywords"`
			OwnerUrls             []string `json:"ownerUrls"`
			ChannelUrl            string   `json:"channelUrl"`
			IsFamilySafe          bool     `json:"isFamilySafe"`
			AvailableCountryCodes []string `json:"availableCountryCodes"`
			VanityChannelUrl      string   `json:"vanityChannelUrl"`
		} `json:"channelMetadataRenderer"`
	} `json:"metadata"`
	Microformat struct {
		MicroformatDataRenderer struct {
			UrlCanonical string `json:"urlCanonical"`
			Title        string `json:"title"`
			Description  string `json:"description"`
			Thumbnail    struct {
				Thumbnails []struct {
					Url    string `json:"url"`
					Width  int    `json:"width"`
					Height int    `json:"height"`
				} `json:"thumbnails"`
			} `json:"thumbnail"`
			SiteName           string   `json:"siteName"`
			AppName            string   `json:"appName"`
			AndroidPackage     string   `json:"androidPackage"`
			IosAppStoreId      string   `json:"iosAppStoreId"`
			IosAppArguments    string   `json:"iosAppArguments"`
			OgType             string   `json:"ogType"`
			UrlApplinksWeb     string   `json:"urlApplinksWeb"`
			UrlApplinksIos     string   `json:"urlApplinksIos"`
			UrlApplinksAndroid string   `json:"urlApplinksAndroid"`
			UrlTwitterIos      string   `json:"urlTwitterIos"`
			UrlTwitterAndroid  string   `json:"urlTwitterAndroid"`
			TwitterCardType    string   `json:"twitterCardType"`
			TwitterSiteHandle  string   `json:"twitterSiteHandle"`
			SchemaDotOrgType   string   `json:"schemaDotOrgType"`
			Noindex            bool     `json:"noindex"`
			Unlisted           bool     `json:"unlisted"`
			FamilySafe         bool     `json:"familySafe"`
			Tags               []string `json:"tags"`
			AvailableCountries []string `json:"availableCountries"`
			LinkAlternates     []struct {
				HrefUrl string `json:"hrefUrl"`
			} `json:"linkAlternates"`
		} `json:"microformatDataRenderer"`
	} `json:"microformat"`

	Context *ytCfgInnerTubeContext
	// contains filtered or unexported fields
}

func GetChannelVideosPage added in v0.1.51

func GetChannelVideosPage(client *http.Client, channelId string) (*ChannelVideosInitialData, error)

func (*ChannelVideosInitialData) Continue added in v0.1.51

func (cvid *ChannelVideosInitialData) Continue(client *http.Client) error

func (*ChannelVideosInitialData) HasContinuation added in v0.1.51

func (cvid *ChannelVideosInitialData) HasContinuation() bool

func (*ChannelVideosInitialData) SetContent added in v0.1.51

func (cvid *ChannelVideosInitialData) SetContent(ct []RichGridRendererContents)

func (*ChannelVideosInitialData) Videos added in v0.1.51

func (*ChannelVideosInitialData) VideosContent added in v0.1.51

func (cvid *ChannelVideosInitialData) VideosContent() []RichGridRendererContents

type ContinuationEndpoint

type ContinuationEndpoint struct {
	CommandMetadata struct {
		WebCommandMetadata struct {
			SendPost bool   `json:"sendPost"`
			ApiUrl   string `json:"apiUrl"`
		} `json:"webCommandMetadata"`
	} `json:"commandMetadata"`
	ContinuationCommand struct {
		Token   string `json:"token"`
		Request string `json:"request"`
	} `json:"continuationCommand"`
}

type ContinuationItemRenderer

type ContinuationItemRenderer struct {
	Trigger              string               `json:"trigger"`
	ContinuationEndpoint ContinuationEndpoint `json:"continuationEndpoint"`
}

type Format

type Format struct {
	Url              string  `json:"url"`
	MIMEType         string  `json:"mimeType"`
	Bitrate          int     `json:"bitrate"`
	Width            int     `json:"width"`
	Height           int     `json:"height"`
	InitRange        Range   `json:"initRange"`
	IndexRange       Range   `json:"indexRange"`
	LastModified     string  `json:"lastModified"`
	ContentLength    string  `json:"contentLength"`
	Quality          string  `json:"quality"`
	FPS              int     `json:"fps"`
	QualityLabel     string  `json:"qualityLabel"`
	ProjectionType   string  `json:"projectionType"`
	AverageBitrate   int     `json:"averageBitrate"`
	HighReplication  bool    `json:"highReplication"`
	AudioQuality     string  `json:"audioQuality"`
	ApproxDurationMs string  `json:"approxDurationMs"`
	AudioSampleRate  string  `json:"audioSampleRate"`
	AudioChannels    int     `json:"audioChannels"`
	LoudnessDb       float64 `json:"loudnessDb"`
	SignatureCipher  string  `json:"signatureCipher"`
	// contains filtered or unexported fields
}

Format captures stream data provided by YouTube

func (Format) Ext

func (f Format) Ext() string

type Formats

type Formats []*Format

func (Formats) Audio

func (fs Formats) Audio() Formats

func (Formats) Len

func (fs Formats) Len() int

func (Formats) Less

func (fs Formats) Less(i, j int) bool

func (Formats) PreferredAudioFormats

func (fs Formats) PreferredAudioFormats() Formats

func (Formats) PreferredVideoFormats

func (fs Formats) PreferredVideoFormats() Formats

func (Formats) Swap

func (fs Formats) Swap(i, j int)

func (Formats) Video

func (fs Formats) Video() Formats

type GridPlaylistRenderer

type GridPlaylistRenderer struct {
	PlaylistId          string             `json:"playlistId"`
	Title               TextRuns           `json:"title"`
	VideoCountText      TextRuns           `json:"videoCountText"`
	NavigationEndpoint  NavigationEndpoint `json:"navigationEndpoint"`
	VideoCountShortText SimpleText         `json:"videoCountShortText"`
	ViewPlaylistText    TextRuns           `json:"viewPlaylistText"`
	PublishedTimeText   SimpleText         `json:"publishedTimeText,omitempty"`
}

type InitialPlayerResponse

type InitialPlayerResponse struct {
	PlayerUrl         string
	PlayabilityStatus struct {
		Status      string `json:"status"`
		Reason      string `json:"reason"`
		ErrorScreen struct {
			PlayerErrorMessageRenderer struct {
				SubReason SimpleText `json:"subreason"`
			} `json:"playerErrorMessageRenderer"`
		} `json:"errorScreen"`
	} `json:"playabilityStatus"`
	StreamingData struct {
		ExpiresInSeconds string  `json:"expiresInSeconds"`
		Formats          Formats `json:"formats"`
		AdaptiveFormats  Formats `json:"adaptiveFormats"`
		HLSManifestUrl   string  `json:"hlsManifestUrl"`
	} `json:"streamingData"`
	VideoDetails 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 []Thumbnail `json:"thumbnails"`
		} `json:"thumbnail"`
		ViewCount string `json:"viewCount"`
		Author    string `json:"author"`
		IsPrivate bool   `json:"isPrivate"`
	} `json:"videoDetails"`
	Microformat struct {
		PlayerMicroformatRenderer struct {
			Thumbnail struct {
				Thumbnails []Thumbnail `json:"thumbnails"`
			} `json:"thumbnail"`
			Title              SimpleText `json:"title"`
			Description        SimpleText `json:"description"`
			OwnerProfileUrl    string     `json:"ownerProfileUrl"`
			OwnerChannelName   string     `json:"ownerChannelName"`
			ExternalChannelId  string     `json:"externalChannelId"`
			IsFamilySafe       bool       `json:"IsFamilySafe"`
			AvailableCountries []string   `json:"availableCountries"`
			IsUnlisted         bool       `json:"isUnlisted"`
			ViewCount          string     `json:"viewCount"`
			Category           string     `json:"category"`
			PublishDate        string     `json:"publishDate"`
			UploadDate         string     `json:"uploadDate"`
		} `json:"playerMicroformatRenderer"`
	} `json:"microformat"`
	Captions struct {
		PlayerCaptionsTracklistRenderer struct {
			CaptionTracks []CaptionTrack `json:"captionTracks"`
			AudioTracks   []struct {
				CaptionTrackIndices []int `json:"captionTrackIndices"`
			} `json:"audioTracks"`
			TranslationLanguages []struct {
				LanguageCode string     `json:"languageCode"`
				LanguageName SimpleText `json:"languageName"`
			} `json:"translationLanguages"`
			DefaultAudioTrackIndex int `json:"defaultAudioTrackIndex"`
		} `json:"playerCaptionsTracklistRenderer"`
	} `json:"captions"`
}

InitialPlayerResponse is a minimal set of data structures required to decode and extract streaming data formats for video URL ytInitialPlayerResponse

func GetVideoPage

func GetVideoPage(client *http.Client, videoId string) (*InitialPlayerResponse, error)

func (*InitialPlayerResponse) BestAdaptiveAudioFormat

func (ipr *InitialPlayerResponse) BestAdaptiveAudioFormat() *Format

func (*InitialPlayerResponse) BestAdaptiveVideoFormat

func (ipr *InitialPlayerResponse) BestAdaptiveVideoFormat() *Format

func (*InitialPlayerResponse) BestFormat

func (ipr *InitialPlayerResponse) BestFormat() *Format

func (*InitialPlayerResponse) PublishDate

func (ipr *InitialPlayerResponse) PublishDate() time.Time

func (*InitialPlayerResponse) SignatureCipher

func (ipr *InitialPlayerResponse) SignatureCipher() bool

func (*InitialPlayerResponse) UploadDate

func (ipr *InitialPlayerResponse) UploadDate() time.Time
type NavigationEndpoint struct {
	ClickTrackingParams string `json:"clickTrackingParams"`
	CommandMetadata     struct {
		WebCommandMetadata struct {
			Url         string `json:"url"`
			WebPageType string `json:"webPageType"`
			RootVe      int    `json:"rootVe"`
			ApiUrl      string `json:"apiUrl"`
		} `json:"webCommandMetadata"`
	} `json:"commandMetadata"`
	BrowseEndpoint struct {
		BrowseId         string `json:"browseId"`
		CanonicalBaseUrl string `json:"canonicalBaseUrl"`
	} `json:"browseEndpoint"`
	WatchEndpoint struct {
		VideoId    string `json:"videoId"`
		PlaylistId string `json:"playlistId"`
	}
}

type PlaylistHeaderRenderer

type PlaylistHeaderRenderer struct {
	PlaylistId      string     `json:"playlistId"`
	Title           SimpleText `json:"title"`
	DescriptionText SimpleText `json:"descriptionText"`
	OwnerText       TextRuns   `json:"ownerText"`
	ViewCountText   SimpleText `json:"viewCountText"`
	Privacy         string     `json:"privacy"`
}

type PlaylistInitialData

type PlaylistInitialData struct {
	Contents struct {
		TwoColumnBrowseResultsRenderer struct {
			Tabs []struct {
				TabRenderer struct {
					Content struct {
						SectionListRenderer struct {
							Contents []struct {
								ItemSectionRenderer struct {
									Contents []struct {
										PlaylistVideoListRenderer struct {
											PlaylistId string                             `json:"playlistId"`
											Contents   []PlaylistVideoListRendererContent `json:"contents"`
										} `json:"playlistVideoListRenderer"`
									} `json:"contents"`
								} `json:"itemSectionRenderer"`
							} `json:"contents"`
						} `json:"sectionListRenderer"`
					} `json:"content"`
				} `json:"tabRenderer"`
			} `json:"tabs"`
		} `json:"twoColumnBrowseResultsRenderer"`
	} `json:"contents"`
	Header struct {
		PlaylistHeaderRenderer PlaylistHeaderRenderer `json:"playlistHeaderRenderer"`
	} `json:"header"`

	Context *ytCfgInnerTubeContext
	// contains filtered or unexported fields
}

PlaylistInitialData is a minimal set of data structures required to decode and extract videoIds for playlist URL ytInitialData

func GetPlaylistPage

func GetPlaylistPage(client *http.Client, playlistId string) (*PlaylistInitialData, error)

func (*PlaylistInitialData) Continue

func (pid *PlaylistInitialData) Continue(client *http.Client) error

func (*PlaylistInitialData) HasContinuation

func (pid *PlaylistInitialData) HasContinuation() bool

func (*PlaylistInitialData) PlaylistContent

func (id *PlaylistInitialData) PlaylistContent() []PlaylistVideoListRendererContent

func (*PlaylistInitialData) PlaylistHeaderRenderer

func (id *PlaylistInitialData) PlaylistHeaderRenderer() *PlaylistHeaderRenderer

func (*PlaylistInitialData) PlaylistOwner

func (id *PlaylistInitialData) PlaylistOwner() string

func (*PlaylistInitialData) SetContent

func (*PlaylistInitialData) Videos

type PlaylistRenderer

type PlaylistRenderer struct {
	PlaylistId         string             `json:"playlistId"`
	Title              SimpleText         `json:"title"`
	VideoCount         string             `json:"videoCount"`
	NavigationEndpoint NavigationEndpoint `json:"navigationEndpoint"`
	ViewPlaylistText   TextRuns           `json:"viewPlaylistText"`
	ShortBylineText    TextRuns           `json:"shortBylineText"`
	Videos             []struct {
		ChildVideoRenderer struct {
			Title              SimpleText         `json:"title"`
			NavigationEndpoint NavigationEndpoint `json:"navigationEndpoint"`
			LengthText         SimpleText         `json:"lengthText"`
			VideoId            string             `json:"videoId"`
		} `json:"childVideoRenderer"`
	} `json:"videos"`
	VideoCountText TextRuns `json:"videoCountText"`
	TrackingParams string   `json:"trackingParams"`
	ThumbnailText  TextRuns `json:"thumbnailText"`
	LongBylineText TextRuns `json:"longBylineText"`
}

type PlaylistVideoListRendererContent

type PlaylistVideoListRendererContent struct {
	PlaylistVideoRenderer    PlaylistVideoRenderer
	ContinuationItemRenderer ContinuationItemRenderer
}

type PlaylistVideoRenderer

type PlaylistVideoRenderer struct {
	VideoId       string   `json:"videoId"`
	Title         TextRuns `json:"title"`
	LengthSeconds string   `json:"lengthSeconds"`
	// normally contains video channel title
	ShortBylineText TextRuns `json:"shortBylineText"`
}

type Range

type Range struct {
	Start string `json:"start"`
	End   string `json:"end"`
}

type RichGridRendererContents added in v0.1.51

type RichGridRendererContents struct {
	RichItemRenderer struct {
		Content struct {
			VideoRenderer struct {
				VideoId            string   `json:"videoId"`
				Title              TextRuns `json:"title"`
				DescriptionSnippet struct {
					Runs []struct {
						Text string `json:"text"`
					} `json:"runs"`
				} `json:"descriptionSnippet"`
				PublishedTimeText struct {
					SimpleText string `json:"simpleText"`
				} `json:"publishedTimeText"`
				LengthText struct {
					Accessibility struct {
						AccessibilityData struct {
							Label string `json:"label"`
						} `json:"accessibilityData"`
					} `json:"accessibility"`
					SimpleText string `json:"simpleText"`
				} `json:"lengthText"`
				ViewCountText struct {
					SimpleText string `json:"simpleText"`
				} `json:"viewCountText"`
				IsWatched bool `json:"isWatched,omitempty"`
			} `json:"videoRenderer"`
		} `json:"content"`
	} `json:"richItemRenderer,omitempty"`
	ContinuationItemRenderer ContinuationItemRenderer `json:"continuationItemRenderer,omitempty"`
}

type SearchInitialData

type SearchInitialData struct {
	EstimatedResults string `json:"estimatedResults"`
	Contents         struct {
		TwoColumnSearchResultsRenderer struct {
			PrimaryContents struct {
				SectionListRenderer struct {
					Contents []struct {
						ItemSectionRenderer struct {
							Contents []struct {
								ChannelRenderer  ChannelRenderer  `json:"channelRenderer,omitempty"`
								PlaylistRenderer PlaylistRenderer `json:"playlistRenderer,omitempty"`
								VideoRenderer    VideoRenderer    `json:"videoRenderer,omitempty"`
							} `json:"contents"`
						} `json:"itemSectionRenderer,omitempty"`
						ContinuationItemRenderer ContinuationItemRenderer `json:"continuationItemRenderer,omitempty"`
					} `json:"contents"`
				} `json:"sectionListRenderer"`
			} `json:"primaryContents"`
		} `json:"twoColumnSearchResultsRenderer"`
	} `json:"contents"`
	Refinements []string `json:"refinements"`
	Context     *ytCfgInnerTubeContext
}

func GetSearchResultsPage

func GetSearchResultsPage(client *http.Client, terms ...string) (*SearchInitialData, error)

func (*SearchInitialData) ChannelRenderers

func (sid *SearchInitialData) ChannelRenderers() []ChannelRenderer

func (*SearchInitialData) PlaylistRenderers

func (sid *SearchInitialData) PlaylistRenderers() []PlaylistRenderer

func (*SearchInitialData) VideoRenderers

func (sid *SearchInitialData) VideoRenderers() []VideoRenderer

type SimpleText

type SimpleText struct {
	SimpleText string `json:"simpleText"`
}

type Text

type Text struct {
	Text string `json:"text"`
}

type TextRuns

type TextRuns struct {
	Runs []struct {
		Text string `json:"text"`
	} `json:"runs"`
	Accessibility struct {
		AccessibilityData struct {
			Label string `json:"label"`
		} `json:"accessibilityData"`
	} `json:"accessibility"`
}

func (*TextRuns) String

func (tr *TextRuns) String() string

type Thumbnail

type Thumbnail struct {
	Url    string `json:"url"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
}

type ThumbnailQuality

type ThumbnailQuality int
const (
	ThumbnailQualityUnknown ThumbnailQuality = iota
	ThumbnailQualitySD
	ThumbnailQualityMQ
	ThumbnailQualityHQ
	ThumbnailQualityMaxRes
)

func AllThumbnailQualities

func AllThumbnailQualities() []ThumbnailQuality

func LowerQuality

func LowerQuality(q ThumbnailQuality) ThumbnailQuality

func ParseThumbnailQuality

func ParseThumbnailQuality(tqs string) ThumbnailQuality

func (ThumbnailQuality) String

func (tq ThumbnailQuality) String() string

type VideoIdTitleLengthChannel

type VideoIdTitleLengthChannel struct {
	VideoId       string
	Title         string
	LengthSeconds string
	Channel       string
}

type VideoRenderer

type VideoRenderer struct {
	VideoId            string             `json:"videoId"`
	Title              TextRuns           `json:"title"`
	LongBylineText     TextRuns           `json:"longBylineText"`
	PublishedTimeText  SimpleText         `json:"publishedTimeText"`
	LengthText         SimpleText         `json:"lengthText"`
	ViewCountText      SimpleText         `json:"viewCountText"`
	NavigationEndpoint NavigationEndpoint `json:"navigationEndpoint"`
	OwnerText          TextRuns           `json:"ownerText"`
	ShortBylineText    TextRuns           `json:"shortBylineText"`
	ShortViewCountText SimpleText         `json:"shortViewCountText"`
	IsWatched          bool               `json:"isWatched,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL