forked from kkdai/youtube
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresponse_data.go
More file actions
162 lines (156 loc) · 5.76 KB
/
response_data.go
File metadata and controls
162 lines (156 loc) · 5.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package youtube
type playerResponseData struct {
PlayabilityStatus struct {
Status string `json:"status"`
Reason string `json:"reason"`
PlayableInEmbed bool `json:"playableInEmbed"`
ContextParams string `json:"contextParams"`
} `json:"playabilityStatus"`
StreamingData struct {
ExpiresInSeconds string `json:"expiresInSeconds"`
Formats []Format `json:"formats"`
AdaptiveFormats []Format `json:"adaptiveFormats"`
DashManifestURL string `json:"dashManifestUrl"`
HlsManifestURL string `json:"hlsManifestUrl"`
} `json:"streamingData"`
Captions struct {
PlayerCaptionsRenderer struct {
BaseURL string `json:"baseUrl"`
Visibility string `json:"visibility"`
} `json:"playerCaptionsRenderer"`
PlayerCaptionsTracklistRenderer struct {
CaptionTracks []struct {
BaseURL string `json:"baseUrl"`
Name struct {
SimpleText string `json:"simpleText"`
} `json:"name"`
VssID string `json:"vssId"`
LanguageCode string `json:"languageCode"`
Kind string `json:"kind"`
IsTranslatable bool `json:"isTranslatable"`
} `json:"captionTracks"`
AudioTracks []struct {
CaptionTrackIndices []int `json:"captionTrackIndices"`
} `json:"audioTracks"`
TranslationLanguages []struct {
LanguageCode string `json:"languageCode"`
LanguageName struct {
SimpleText string `json:"simpleText"`
} `json:"languageName"`
} `json:"translationLanguages"`
DefaultAudioTrackIndex int `json:"defaultAudioTrackIndex"`
} `json:"playerCaptionsTracklistRenderer"`
} `json:"captions"`
VideoDetails struct {
VideoID string `json:"videoId"`
Title string `json:"title"`
LengthSeconds string `json:"lengthSeconds"`
ChannelID string `json:"channelId"`
IsOwnerViewing bool `json:"isOwnerViewing"`
ShortDescription string `json:"shortDescription"`
IsCrawlable bool `json:"isCrawlable"`
Thumbnail struct {
Thumbnails []Thumbnail `json:"thumbnails"`
} `json:"thumbnail"`
AverageRating float64 `json:"averageRating"`
AllowRatings bool `json:"allowRatings"`
ViewCount string `json:"viewCount"`
Author string `json:"author"`
IsPrivate bool `json:"isPrivate"`
IsUnpluggedCorpus bool `json:"isUnpluggedCorpus"`
IsLiveContent bool `json:"isLiveContent"`
} `json:"videoDetails"`
PlayerConfig struct {
AudioConfig struct {
LoudnessDb float64 `json:"loudnessDb"`
PerceptualLoudnessDb float64 `json:"perceptualLoudnessDb"`
EnablePerFormatLoudness bool `json:"enablePerFormatLoudness"`
} `json:"audioConfig"`
StreamSelectionConfig struct {
MaxBitrate string `json:"maxBitrate"`
} `json:"streamSelectionConfig"`
MediaCommonConfig struct {
DynamicReadaheadConfig struct {
MaxReadAheadMediaTimeMs int `json:"maxReadAheadMediaTimeMs"`
MinReadAheadMediaTimeMs int `json:"minReadAheadMediaTimeMs"`
ReadAheadGrowthRateMs int `json:"readAheadGrowthRateMs"`
} `json:"dynamicReadaheadConfig"`
} `json:"mediaCommonConfig"`
} `json:"playerConfig"`
Storyboards struct {
PlayerStoryboardSpecRenderer struct {
Spec string `json:"spec"`
} `json:"playerStoryboardSpecRenderer"`
} `json:"storyboards"`
Microformat struct {
PlayerMicroformatRenderer struct {
Thumbnail struct {
Thumbnails []struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"thumbnails"`
} `json:"thumbnail"`
Embed struct {
IframeURL string `json:"iframeUrl"`
FlashURL string `json:"flashUrl"`
Width int `json:"width"`
Height int `json:"height"`
FlashSecureURL string `json:"flashSecureUrl"`
} `json:"embed"`
Title struct {
SimpleText string `json:"simpleText"`
} `json:"title"`
Description struct {
SimpleText string `json:"simpleText"`
} `json:"description"`
LengthSeconds string `json:"lengthSeconds"`
OwnerProfileURL string `json:"ownerProfileUrl"`
ExternalChannelID string `json:"externalChannelId"`
AvailableCountries []string `json:"availableCountries"`
IsUnlisted bool `json:"isUnlisted"`
HasYpcMetadata bool `json:"hasYpcMetadata"`
ViewCount string `json:"viewCount"`
Category string `json:"category"`
PublishDate string `json:"publishDate"`
OwnerChannelName string `json:"ownerChannelName"`
UploadDate string `json:"uploadDate"`
} `json:"playerMicroformatRenderer"`
} `json:"microformat"`
}
type Format struct {
ItagNo int `json:"itag"`
URL string `json:"url"`
MimeType string `json:"mimeType"`
Quality string `json:"quality"`
Cipher string `json:"signatureCipher"`
Bitrate int `json:"bitrate"`
FPS int `json:"fps"`
Width int `json:"width"`
Height int `json:"height"`
LastModified string `json:"lastModified"`
ContentLength int64 `json:"contentLength,string"`
QualityLabel string `json:"qualityLabel"`
ProjectionType string `json:"projectionType"`
AverageBitrate int `json:"averageBitrate"`
AudioQuality string `json:"audioQuality"`
ApproxDurationMs string `json:"approxDurationMs"`
AudioSampleRate string `json:"audioSampleRate"`
AudioChannels int `json:"audioChannels"`
// InitRange is only available for adaptive formats
InitRange *struct {
Start string `json:"start"`
End string `json:"end"`
} `json:"initRange"`
// IndexRange is only available for adaptive formats
IndexRange *struct {
Start string `json:"start"`
End string `json:"end"`
} `json:"indexRange"`
}
type Thumbnails []Thumbnail
type Thumbnail struct {
URL string
Width uint
Height uint
}