Open fireattack opened 2 years ago
看下这个接口的返回
https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo?room_id=${roomId}&protocol=0,1&format=0,1,2&codec=0,1,2&qn=10000&platform=web&ptype=16
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"room_id": 5440,
"short_id": 1,
"uid": 9617619,
"is_hidden": false,
"is_locked": false,
"is_portrait": false,
"live_status": 1,
"hidden_till": 0,
"lock_till": 0,
"encrypted": false,
"pwd_verified": true,
"live_time": 1641624603,
"room_shield": 1,
"all_special_types": [],
"playurl_info": {
"conf_json": "{\"cdn_rate\":10000,\"report_interval_sec\":150}",
"playurl": {
"cid": 5440,
"g_qn_desc": [
{
"qn": 20000,
"desc": "4K",
"hdr_desc": ""
},
{
"qn": 10000,
"desc": "原画",
"hdr_desc": ""
},
{
"qn": 401,
"desc": "蓝光(杜比)",
"hdr_desc": ""
},
{
"qn": 400,
"desc": "蓝光",
"hdr_desc": "HDR"
},
{
"qn": 250,
"desc": "超清",
"hdr_desc": "HDR"
},
{
"qn": 150,
"desc": "高清",
"hdr_desc": ""
},
{
"qn": 80,
"desc": "流畅",
"hdr_desc": ""
}
],
"stream": [
{
"protocol_name": "http_stream",
"format": [
{
"format_name": "flv",
"codec": [
{
"codec_name": "avc",
"current_qn": 10000,
"accept_qn": [
10000,
400,
250,
150,
80
],
"base_url": "/live-bvc/203728/live_9617619_6384511.flv?expires=1641638937\u0026len=0\u0026oi=2575220790\u0026pt=web\u0026qn=10000\u0026trid=100067fd542b5a01471e8bf1197a30694f98\u0026sigparams=cdn,expires,len,oi,pt,qn,trid",
"url_info": [
{
"host": "https://d1--ov-gotcha05.bilivideo.com",
"extra": "\u0026cdn=ov-gotcha05\u0026sign=90ea12fd9ac9e10b434caa1e5aff561e\u0026sk=7447800cf0c1f01f93de64f3f13e39f0\u0026p2p_type=0\u0026src=9\u0026sl=9\u0026free_type=0\u0026flowtype=1\u0026machinezone=ylf\u0026pp=rtmp\u0026slot=2\u0026source=onetier\u0026order=1\u0026site=e47e611fdeceb2c9d63f464dcb73051d",
"stream_ttl": 3600
},
{
"host": "https://d1--ov-gotcha07.bilivideo.com",
"extra": "\u0026cdn=ov-gotcha07\u0026sign=043f91d625d7f64afd767e0d0b1d2cb2\u0026sk=7447800cf0c1f01f93de64f3f13e39f0\u0026p2p_type=0\u0026src=9\u0026sl=9\u0026free_type=0\u0026flowtype=1\u0026machinezone=ylf\u0026pp=rtmp\u0026slot=2\u0026source=onetier\u0026order=2\u0026site=e47e611fdeceb2c9d63f464dcb73051d",
"stream_ttl": 3600
}
],
"hdr_qn": null
},
{
"codec_name": "hevc",
"current_qn": 0,
"accept_qn": [
400,
250
],
"base_url": "",
"url_info": null,
"hdr_qn": null
}
]
}
]
},
{
"protocol_name": "http_hls",
"format": [
{
"format_name": "ts",
"codec": [
{
"codec_name": "avc",
"current_qn": 10000,
"accept_qn": [
10000,
400,
250,
150,
80
],
"base_url": "/live-bvc/203728/live_9617619_6384511.m3u8?expires=1641638937\u0026len=0\u0026oi=2575220790\u0026pt=web\u0026qn=10000\u0026trid=100367fd542b5a01471e8bf1197a30694f98\u0026sigparams=cdn,expires,len,oi,pt,qn,trid",
"url_info": [
{
"host": "https://d1--ov-gotcha105.bilivideo.com",
"extra": "\u0026cdn=ov-gotcha05\u0026sign=c7526930898cdc9b489eb184d77d54ee\u0026sk=7447800cf0c1f01f93de64f3f13e39f0\u0026p2p_type=0\u0026src=9\u0026sl=9\u0026free_type=0\u0026flowtype=1\u0026machinezone=ylf\u0026pp=rtmp\u0026slot=2\u0026source=onetier\u0026order=1\u0026site=e47e611fdeceb2c9d63f464dcb73051d",
"stream_ttl": 3600
}
],
"hdr_qn": null
}
]
}
]
}
],
"p2p_data": {
"p2p": false,
"p2p_type": 0,
"m_p2p": false,
"m_servers": null
},
"dolby_qn": null
}
}
}
}
看起来没问题。。重装扩展管用不
不管用。。
我没理解错代码逻辑的话,好像只有notifly了playlist
或者playlist_chunklist
才会在minyami的菜单加入项目吧?
这里是fetch
这个api里的几1个stream的m3u8似乎都只是chunkList
而不是playlist
(没有if (responseText.match(/#EXT-X-STREAM-INF/)
)
https://d1--ov-gotcha105.bilivideo.com/live-bvc/166706/live_9617619_6384511.m3u8?expires=1641640197&len=0&oi=1112277554&pt=web&qn=10000&trid=1003ad33903b98274b789ef993de4ba47425&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=ov-gotcha05&sign=c2a2bb898a322413cff5b8dac46cc46e&sk=7447800cf0c1f01f93de64f3f13e39f0&p2p_type=0&src=9&sl=10&free_type=0&flowtype=1&machinezone=ylf&pp=rtmp&slot=2&source=onetier&order=1&site=0e7cb3208510410746945f702a6b0dc8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:3.980,
live_9617619_6384511/1641636720.ts?wsApp=HLS&wsMonitor=0
#EXTINF:3.989,
live_9617619_6384511/1641636721.ts?wsApp=HLS&wsMonitor=0
所以正常来说应该是哪里能获取到playlist
呢?因为感觉看代码并不会获取到
似乎 bili 这个 API 里之前返回的都是 master m3u8 我看下能不能适配下
发现这个 chunkList TTL 只有3600,有点讨厌。超过1小时就403了
不清楚原来有这个问题没
别人说无法重现,我也不知道啥情况,姑且汇报下吧
在extension的控制台能看到确实是获取到了chunkList:
(部分信息打了个码)
但是插件菜单里是“暂无数据”。
似乎
background.js
里对"type": "chunklist",
是没有任何处理的(只有playlist / playlist_chunklist / key / cookies
才有处理)。不清楚是chunkList
应该写成playlist_chunklist
,还是理论上应该获取到的东西没获取到?