-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathtypes.go
179 lines (156 loc) · 4.64 KB
/
types.go
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
package bilibili
// {"code":0,"message":"0","ttl":1,"data":{"token":"aaa"}}
// {"code":-101,"message":"账号未登录","ttl":1}
type tokenData struct {
Token string `json:"token"`
}
type token struct {
Code int `json:"code"`
Message string `json:"message"`
Data tokenData `json:"data"`
}
type Interaction struct {
Interaction bool `json:"interaction"`
}
type EpVideoInfo struct {
Aid int `json:"aid"`
Bvid string `json:"bvid"`
Cid int `json:"cid"`
DeliveryBusinessFragmentVideo bool `json:"delivery_business_fragment_video"`
DeliveryFragmentVideo bool `json:"delivery_fragment_video"`
EpID int `json:"ep_id"`
EpStatus int `json:"ep_status"`
Interaction Interaction `json:"interaction"`
LongTitle string `json:"long_title"`
Title string `json:"title"`
}
type bangumiData struct {
EpInfo EpVideoInfo `json:"epInfo"`
EpList []EpVideoInfo `json:"epList"`
}
type videoPagesData struct {
Cid int `json:"cid"`
Part string `json:"part"`
Page int `json:"page"`
}
type multiPageVideoData struct {
Title string `json:"title"`
Pages []videoPagesData `json:"pages"`
}
type episode struct {
Aid int `json:"aid"`
Cid int `json:"cid"`
Title string `json:"title"`
BVid string `json:"bvid"`
}
type multiEpisodeData struct {
Seasionid int `json:"season_id"`
Episodes []episode `json:"episodes"`
}
type multiPage struct {
Aid int `json:"aid"`
BVid string `json:"bvid"`
Sections []multiEpisodeData `json:"sections"`
VideoData multiPageVideoData `json:"videoData"`
}
type dashStream struct {
ID int `json:"id"`
BaseURL string `json:"baseUrl"`
Bandwidth int `json:"bandwidth"`
MimeType string `json:"mimeType"`
Codecid int `json:"codecid"`
Codecs string `json:"codecs"`
}
type dashStreams struct {
Video []dashStream `json:"video"`
Audio []dashStream `json:"audio"`
}
type dashInfo struct {
CurQuality int `json:"quality"`
Description []string `json:"accept_description"`
Quality []int `json:"accept_quality"`
Streams dashStreams `json:"dash"`
DURLFormat string `json:"format"`
DURLs []dURL `json:"durl"`
}
type dURL struct {
URL string `json:"url"`
Size int64 `json:"size"`
}
type dash struct {
Code int `json:"code"`
Message string `json:"message"`
Data dashInfo `json:"data"`
Result dashInfo `json:"result"`
}
var qualityString = map[int]string{
127: "超高清 8K",
120: "超清 4K",
116: "高清 1080P60",
74: "高清 720P60",
112: "高清 1080P+",
80: "高清 1080P",
64: "高清 720P",
48: "高清 720P",
32: "清晰 480P",
16: "流畅 360P",
15: "流畅 360P",
}
type subtitleData struct {
From float32 `json:"from"`
To float32 `json:"to"`
Location int `json:"location"`
Content string `json:"content"`
}
type bilibiliSubtitleFormat struct {
FontSize float32 `json:"font_size"`
FontColor string `json:"font_color"`
BackgroundAlpha float32 `json:"background_alpha"`
BackgroundColor string `json:"background_color"`
Stroke string `json:"Stroke"`
Body []subtitleData `json:"body"`
}
type subtitleProperty struct {
ID int64 `json:"id"`
Lan string `json:"lan"`
LanDoc string `json:"lan_doc"`
SubtitleUrl string `json:"subtitle_url"`
}
type subtitleInfo struct {
AllowSubmit bool `json:"allow_submit"`
SubtitleList []subtitleProperty `json:"subtitles"`
}
type bilibiliWebInterfaceData struct {
Bvid string `json:"bvid"`
SubtitleInfo subtitleInfo `json:"subtitle"`
}
type bilibiliWebInterface struct {
Code int `json:"code"`
Data bilibiliWebInterfaceData `json:"data"`
}
type festival struct {
VideoSections []struct {
Id int64 `json:"id"`
Title string `json:"title"`
Type int `json:"type"`
} `json:"videoSections"`
Episodes []episode `json:"episodes"`
VideoInfo struct {
Aid int `json:"aid"`
BVid string `json:"bvid"`
Cid int `json:"cid"`
Title string `json:"title"`
Desc string `json:"desc"`
Pages []struct {
Cid int `json:"cid"`
Duration int `json:"duration"`
Page int `json:"page"`
Part string `json:"part"`
Dimension struct {
Width int `json:"width"`
Height int `json:"height"`
Rotate int `json:"rotate"`
} `json:"dimension"`
} `json:"pages"`
} `json:"videoInfo"`
}