今天发现了一个bilibili视频信息api:

https://api.bilibili.com/x/player/playurl

bilibili在浏览器中请求的负载:

image

但经过逝验,只要aid bvid cid就可以使用了。(猜测3216中有一个与清晰度有关。)(更新| 确认qn对应以下accept_quality中的清晰度(若无则返回最高清晰度))

其中aid为视频av号,bvid为视频bv号,cid为某不知名视频属性,

以上三者都可以通过下面的api获取:

https://api.bilibili.com/x/web-interface/view?bvid=(视频BV号)

视频信息api返回值示例:

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
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"from": "local",
"result": "suee",
"message": "",
"quality": 32,
"format": "flv480",
"timelength": 128185,
"accept_format": "flv_p60,flv,flv720,flv480,mp4",
"accept_description": [
"高清 1080P60",
"高清 1080P",
"高清 720P",
"清晰 480P",
"流畅 360P"
],
"accept_quality": [
116,
80,
64,
32,
16
],
"video_codecid": 7,
"seek_param": "start",
"seek_type": "offset",
"durl": [
{
"order": 1,
"length": 128185,
"size": 9765560,
"ahead": "",
"vhead": "",
"url": "https://upos-sz-estgoss.bilivideo.com/upgcxcode/99/50/729945099/729945099-1-32.flv?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1663406029&gen=playurlv2&os=upos&oi=3027197674&trid=8ef3bf5cbff54324a00aa8d85ef0512du&mid=0&platform=pc&upsig=0fd0ee35625e476b83f280cf1403e424&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&bvc=vod&nettype=0&orderid=0,3&agrr=1&bw=76293&logo=80000000",
"backup_url": [
"https://upos-sz-mirrorali.bilivideo.com/upgcxcode/99/50/729945099/729945099-1-32.flv?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1663406029&gen=playurlv2&os=alibv&oi=3027197674&trid=8ef3bf5cbff54324a00aa8d85ef0512du&mid=0&platform=pc&upsig=ff054aac9dde022bce533c98411d8b23&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&bvc=vod&nettype=0&orderid=1,3&agrr=1&bw=76293&logo=40000000",
"https://upos-sz-mirroralib.bilivideo.com/upgcxcode/99/50/729945099/729945099-1-32.flv?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1663406029&gen=playurlv2&os=alibbv&oi=3027197674&trid=8ef3bf5cbff54324a00aa8d85ef0512du&mid=0&platform=pc&upsig=de74a2dac644d658a7129cf6482c5177&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&bvc=vod&nettype=0&orderid=2,3&agrr=1&bw=76293&logo=40000000"
]
}
],
"support_formats": [
{
"quality": 116,
"format": "flv_p60",
"new_description": "1080P 60帧",
"display_desc": "1080P",
"superscript": "60帧",
"codecs": null
},
{
"quality": 80,
"format": "flv",
"new_description": "1080P 高清",
"display_desc": "1080P",
"superscript": "",
"codecs": null
},
{
"quality": 64,
"format": "flv720",
"new_description": "720P 高清",
"display_desc": "720P",
"superscript": "",
"codecs": null
},
{
"quality": 32,
"format": "flv480",
"new_description": "480P 清晰",
"display_desc": "480P",
"superscript": "",
"codecs": null
},
{
"quality": 16,
"format": "mp4",
"new_description": "360P 流畅",
"display_desc": "360P",
"superscript": "",
"codecs": null
}
],
"high_format": null,
"last_play_time": 0,
"last_play_cid": 0
}
}