forked from iawia002/lux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
87 lines (74 loc) · 1.89 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
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 bangumiEpData struct {
Aid int `json:"aid"`
Cid int `json:"cid"`
BVid string `json:"bvid"`
ID int `json:"id"`
EpID int `json:"ep_id"`
}
type bangumiData struct {
EpInfo bangumiEpData `json:"epInfo"`
EpList []bangumiEpData `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 multiPage struct {
Aid int `json:"aid"`
BVid string `json:"bvid"`
VideoData multiPageVideoData `json:"videoData"`
}
type dashStream struct {
ID int `json:"id"`
BaseURL string `json:"baseUrl"`
Bandwidth int `json:"bandwidth"`
}
type dashStreams struct {
Video []dashStream `json:"video"`
Audio []dashStream `json:"audio"`
}
type dURL struct {
Size int64 `json:"size"`
URL string `json:"url"`
}
type dashInfo struct {
CurQuality int `json:"quality"`
Description []string `json:"accept_description"`
Quality []int `json:"accept_quality"`
Streams dashStreams `json:"dash"`
DURL []dURL `json:"durl"`
}
type dash struct {
Code int `json:"code"`
Message string `json:"message"`
Data dashInfo `json:"data"`
Result dashInfo `json:"result"`
}
var qualityString = map[int]string{
120: "超清 4K",
116: "高清 1080P60",
74: "高清 720P60",
112: "高清 1080P+",
80: "高清 1080P",
64: "高清 720P",
48: "高清 720P",
32: "清晰 480P",
16: "流畅 360P",
15: "流畅 360P",
}