Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Android = Context{ Client: Client{Name: "ANDROID", Version: "17.09.33"}, }
var Duration = map[string]protobuf.Uint64{
"Under 4 minutes": 1,
"4 - 20 minutes": 3,
"Over 20 minutes": 2,
}
var Embed = Context{ Client: Client{Name: "ANDROID", Screen: "EMBED", Version: "17.09.33"}, ThirdParty: &ThirdParty{EmbedURL: origin}, }
HsUATh_Nc2U
var Features = map[string]protobuf.Number{
"360°": 15,
"3D": 7,
"4K": 14,
"Creative Commons": 6,
"HD": 4,
"HDR": 25,
"Live": 8,
"Location": 23,
"Purchased": 9,
"Subtitles/CC": 5,
"VR180": 26,
}
var Images = []Image{ {Width: 120, Height: 90, Base: "default.jpg"}, {Width: 120, Height: 90, Base: "1.jpg"}, {Width: 120, Height: 90, Base: "2.jpg"}, {Width: 120, Height: 90, Base: "3.jpg"}, {Width: 120, Height: 90, Base: "default.webp"}, {Width: 120, Height: 90, Base: "1.webp"}, {Width: 120, Height: 90, Base: "2.webp"}, {Width: 120, Height: 90, Base: "3.webp"}, {Width: 320, Height: 180, Base: "mq1.jpg", Crop: true}, {Width: 320, Height: 180, Base: "mq2.jpg", Crop: true}, {Width: 320, Height: 180, Base: "mq3.jpg", Crop: true}, {Width: 320, Height: 180, Base: "mqdefault.jpg"}, {Width: 320, Height: 180, Base: "mq1.webp", Crop: true}, {Width: 320, Height: 180, Base: "mq2.webp", Crop: true}, {Width: 320, Height: 180, Base: "mq3.webp", Crop: true}, {Width: 320, Height: 180, Base: "mqdefault.webp"}, {Width: 480, Height: 360, Base: "0.jpg"}, {Width: 480, Height: 360, Base: "hqdefault.jpg"}, {Width: 480, Height: 360, Base: "hq1.jpg"}, {Width: 480, Height: 360, Base: "hq2.jpg"}, {Width: 480, Height: 360, Base: "hq3.jpg"}, {Width: 480, Height: 360, Base: "0.webp"}, {Width: 480, Height: 360, Base: "hqdefault.webp"}, {Width: 480, Height: 360, Base: "hq1.webp"}, {Width: 480, Height: 360, Base: "hq2.webp"}, {Width: 480, Height: 360, Base: "hq3.webp"}, {Width: 640, Height: 480, Base: "sddefault.jpg"}, {Width: 640, Height: 480, Base: "sd1.jpg"}, {Width: 640, Height: 480, Base: "sd2.jpg"}, {Width: 640, Height: 480, Base: "sd3.jpg"}, {Width: 640, Height: 480, Base: "sddefault.webp"}, {Width: 640, Height: 480, Base: "sd1.webp"}, {Width: 640, Height: 480, Base: "sd2.webp"}, {Width: 640, Height: 480, Base: "sd3.webp"}, {Width: 1280, Height: 720, Base: "hq720.jpg"}, {Width: 1280, Height: 720, Base: "maxresdefault.jpg"}, {Width: 1280, Height: 720, Base: "maxres1.jpg"}, {Width: 1280, Height: 720, Base: "maxres2.jpg"}, {Width: 1280, Height: 720, Base: "maxres3.jpg"}, {Width: 1280, Height: 720, Base: "hq720.webp"}, {Width: 1280, Height: 720, Base: "maxresdefault.webp"}, {Width: 1280, Height: 720, Base: "maxres1.webp"}, {Width: 1280, Height: 720, Base: "maxres2.webp"}, {Width: 1280, Height: 720, Base: "maxres3.webp"}, }
var LogLevel format.LogLevel
var Mweb = Context{ Client: Client{Name: "MWEB", Version: "2.20211109.01.00"}, }
var SortBy = map[string]protobuf.Uint64{
"Relevance": 0,
"Upload date": 2,
"View count": 3,
"Rating": 1,
}
var Type = map[string]protobuf.Uint64{
"Video": 1,
"Channel": 2,
"Playlist": 3,
"Movie": 4,
}
var UploadDate = map[string]protobuf.Uint64{
"Last hour": 1,
"Today": 2,
"This week": 3,
"This month": 4,
"This year": 5,
}
Functions ¶
func VideoID ¶ added in v1.46.8
https://youtube.com/shorts/9Vsdft81Q6w https://youtube.com/watch?v=XY-hOqcPGCY
Types ¶
type Context ¶ added in v1.14.7
type Context struct { Client Client `json:"client"` ThirdParty *ThirdParty `json:"thirdParty,omitempty"` }
func (Context) PlayerHeader ¶ added in v1.48.8
type Exchange ¶ added in v1.20.3
func OpenExchange ¶ added in v1.44.5
type Filter ¶ added in v1.37.1
func (Filter) UploadDate ¶ added in v1.37.1
type Format ¶
type Format struct { AudioQuality string AverageBitrate int ContentLength int64 `json:"contentLength,string"` Height int MimeType string QualityLabel string URL string Width int }
averageBitrate is a better marker for quality than bitrate. For example, if you look a video: 7WTEB7Qbt4U you get this:
itag | bitrate | averageBitrate | contentLength -----|---------|----------------|-------------- 136 | 1038025 | 286687 | 6891870 247 | 1192816 | 513601 | 12346788 398 | 1117347 | 349310 | 8397292
type Height ¶ added in v1.49.5
type Height struct { StreamingData Target int }
We cannot use bitrate to sort, as you end up with different heights:
ID | 480 | 720 low | 720 high | 1080 ------------|--------|---------|----------|----- 7WTEB7Qbt4U | 285106 | 286687 | 513601 | 513675 RPjE9riEhtA | 584072 | 1169166 | 1693812 | 2151670
type Player ¶ added in v1.13.0
type Player struct { PlayabilityStatus struct { Status string // "OK", "LOGIN_REQUIRED" Reason string // "", "Sign in to confirm your age" } VideoDetails struct { VideoID string LengthSeconds int64 `json:"lengthSeconds,string"` ViewCount int64 `json:"viewCount,string"` Author string Title string ShortDescription string } Microformat struct { PlayerMicroformatRenderer struct { PublishDate string // 2013-06-11 } } StreamingData StreamingData }
type Search ¶ added in v1.11.2
type Search struct { Contents struct { SectionListRenderer struct { Contents []struct { ItemSectionRenderer *struct { Contents []Item } } } } }
type StreamingData ¶ added in v1.17.9
type StreamingData struct {
AdaptiveFormats []Format
}
func (StreamingData) Len ¶ added in v1.49.5
func (s StreamingData) Len() int
func (*StreamingData) MediaType ¶ added in v1.50.1
func (s *StreamingData) MediaType() error
func (StreamingData) Swap ¶ added in v1.49.5
func (s StreamingData) Swap(i, j int)
type ThirdParty ¶ added in v1.48.8
type ThirdParty struct {
EmbedURL string `json:"embedUrl"`
}