Documentation
¶
Overview ¶
YouTube
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WebP = PictureFormat{0, "vi_webp", "webp"} JPG = PictureFormat{1, "vi", "jpg"} )
View Source
var ( Key = Auth{"X-Goog-Api-Key", "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"} Verbose = false )
View Source
var ( Android = Client{Name: "ANDROID", Version: "16.05"} Embed = Client{Name: "ANDROID", Screen: "EMBED", Version: "16.05"} Mweb = Client{Name: "MWEB", Version: "2.19700101"} )
View Source
var Params = map[string]map[string]Message{
"SORT BY": {
"Relevance": {
Tag{1, VarintType}, Varint(0),
},
"Rating": {
Tag{1, VarintType}, Varint(1),
},
"Upload date": {
Tag{1, VarintType}, Varint(2),
},
"View count": {
Tag{1, VarintType}, Varint(3),
},
},
"UPLOAD DATE": {
"Last hour": {
Tag{2, BytesType}, LengthPrefix{
Tag{1, VarintType}, Varint(1),
},
},
"Today": {
Tag{2, BytesType}, LengthPrefix{
Tag{1, VarintType}, Varint(2),
},
},
"This week": {
Tag{2, BytesType}, LengthPrefix{
Tag{1, VarintType}, Varint(3),
},
},
"This month": {
Tag{2, BytesType}, LengthPrefix{
Tag{1, VarintType}, Varint(4),
},
},
"This year": {
Tag{2, BytesType}, LengthPrefix{
Tag{1, VarintType}, Varint(5),
},
},
},
"TYPE": {
"Video": {
Tag{2, BytesType}, LengthPrefix{
Tag{2, VarintType}, Varint(1),
},
},
"Channel": {
Tag{2, BytesType}, LengthPrefix{
Tag{2, VarintType}, Varint(2),
},
},
"Playlist": {
Tag{2, BytesType}, LengthPrefix{
Tag{2, VarintType}, Varint(3),
},
},
"Movie": {
Tag{2, BytesType}, LengthPrefix{
Tag{2, VarintType}, Varint(4),
},
},
},
"DURATION": {
"Under 4 minutes": {
Tag{2, BytesType}, LengthPrefix{
Tag{3, VarintType}, Varint(1),
},
},
"Over 20 minutes": {
Tag{2, BytesType}, LengthPrefix{
Tag{3, VarintType}, Varint(2),
},
},
"4 - 20 minutes": {
Tag{2, BytesType}, LengthPrefix{
Tag{3, VarintType}, Varint(3),
},
},
},
"FEATURES": {
"HD": {
Tag{2, BytesType}, LengthPrefix{
Tag{4, VarintType}, Varint(1),
},
},
"Subtitles/CC": {
Tag{2, BytesType}, LengthPrefix{
Tag{5, VarintType}, Varint(1),
},
},
"Creative Commons": {
Tag{2, BytesType}, LengthPrefix{
Tag{6, VarintType}, Varint(1),
},
},
"3D": {
Tag{2, BytesType}, LengthPrefix{
Tag{7, VarintType}, Varint(1),
},
},
"Live": {
Tag{2, BytesType}, LengthPrefix{
Tag{8, VarintType}, Varint(1),
},
},
"Purchased": {
Tag{2, BytesType}, LengthPrefix{
Tag{9, VarintType}, Varint(1),
},
},
"4K": {
Tag{2, BytesType}, LengthPrefix{
Tag{14, VarintType}, Varint(1),
},
},
"360°": {
Tag{2, BytesType}, LengthPrefix{
Tag{15, VarintType}, Varint(1),
},
},
"Location": {
Tag{2, BytesType}, LengthPrefix{
Tag{23, VarintType}, Varint(1),
},
},
"HDR": {
Tag{2, BytesType}, LengthPrefix{
Tag{25, VarintType}, Varint(1),
},
},
"VR180": {
Tag{2, BytesType}, LengthPrefix{
Tag{26, VarintType}, Varint(1),
},
},
},
}
View Source
var Pictures = PictureSlice{ {120, 90, 68, "default", JPG}, {120, 90, 90, "1", JPG}, {120, 90, 90, "2", JPG}, {120, 90, 90, "3", JPG}, {120, 90, 68, "default", WebP}, {120, 90, 90, "1", WebP}, {120, 90, 90, "2", WebP}, {120, 90, 90, "3", WebP}, {320, 180, 180, "mqdefault", JPG}, {320, 180, 320, "mq1", JPG}, {320, 180, 320, "mq2", JPG}, {320, 180, 320, "mq3", JPG}, {320, 180, 180, "mqdefault", WebP}, {320, 180, 320, "mq1", WebP}, {320, 180, 320, "mq2", WebP}, {320, 180, 320, "mq3", WebP}, {480, 360, 270, "0", JPG}, {480, 360, 270, "hqdefault", JPG}, {480, 360, 360, "hq1", JPG}, {480, 360, 360, "hq2", JPG}, {480, 360, 360, "hq3", JPG}, {480, 360, 270, "0", WebP}, {480, 360, 270, "hqdefault", WebP}, {480, 360, 360, "hq1", WebP}, {480, 360, 360, "hq2", WebP}, {480, 360, 360, "hq3", WebP}, {640, 480, 360, "sddefault", JPG}, {640, 480, 480, "sd1", JPG}, {640, 480, 480, "sd2", JPG}, {640, 480, 480, "sd3", JPG}, {640, 480, 360, "sddefault", WebP}, {640, 480, 480, "sd1", WebP}, {640, 480, 480, "sd2", WebP}, {640, 480, 480, "sd3", WebP}, {1280, 720, 720, "hq720", JPG}, {1280, 720, 720, "maxres1", JPG}, {1280, 720, 720, "maxres2", JPG}, {1280, 720, 720, "maxres3", JPG}, {1280, 720, 720, "maxresdefault", JPG}, {1280, 720, 720, "hq720", WebP}, {1280, 720, 720, "maxres1", WebP}, {1280, 720, 720, "maxres2", WebP}, {1280, 720, 720, "maxres3", WebP}, {1280, 720, 720, "maxresdefault", WebP}, }
Functions ¶
func Continuation ¶ added in v1.27.9
func Continuation(videoID string) Message
func ProtoEncode ¶ added in v1.28.0
func ProtoEncode(m Message) string
Types ¶
type Format ¶
type FormatSlice ¶ added in v1.17.8
type FormatSlice []Format
func (FormatSlice) Filter ¶ added in v1.17.8
func (f FormatSlice) Filter(keep func(Format) bool) FormatSlice
func (FormatSlice) Sort ¶ added in v1.17.8
func (f FormatSlice) Sort(less ...func(a, b Format) bool)
type Picture ¶ added in v1.21.9
type Picture struct {
Width int
Height int
SubHeight int
Base string
Format PictureFormat
}
type PictureFormat ¶ added in v1.21.9
type PictureSlice ¶ added in v1.21.9
type PictureSlice []Picture
func (PictureSlice) Filter ¶ added in v1.21.9
func (p PictureSlice) Filter(keep func(Picture) bool) PictureSlice
func (PictureSlice) Sort ¶ added in v1.21.9
func (p PictureSlice) Sort(less ...func(a, b Picture) bool)
type Player ¶ added in v1.13.0
type Player struct {
Microformat struct {
PlayerMicroformatRenderer struct {
AvailableCountries []string
PublishDate string
}
}
PlayabilityStatus struct {
Reason string
Status string
}
StreamingData struct {
AdaptiveFormats FormatSlice
// just including this so I can bail if video is Dash Manifest
DashManifestURL string
}
VideoDetails struct {
Author string
ShortDescription string
Title string
ViewCount int `json:"viewCount,string"`
}
}
func (Player) Description ¶ added in v1.13.0
Click to show internal directories.
Click to hide internal directories.