{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"current_quality": 3,
"accept_quality": [
"4",
"3",
"2"
],
"current_qn": 3,
"quality_description": [
{
"qn": 4,
"desc": "原画"
},
{
"qn": 3,
"desc": "高清"
},
{
"qn": 2,
"desc": "流畅"
}
],
"durl": [
{
"url": "https://d1--cn-gotcha04.bilivideo.com/live-bvc/601131/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha04&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=20e4ac695fbdd1d11d5dac4f93caa783&ptype=0&src=9&sl=1&order=1",
"length": 0,
"order": 1,
"stream_type": 0,
"p2p_type": 0
},
{
"url": "https://d1--cn-gotcha01.bilivideo.com/live-bvc/757951/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha01&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=9deea67bb9e9c1f0fa3886a34aa09473&ptype=0&src=9&sl=1&order=2",
"length": 0,
"order": 2,
"stream_type": 0,
"p2p_type": 0
},
{
"url": "https://d1--cn-gotcha04.bilivideo.com/live-bvc/982058/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha04&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=8753b270960034660184d975d86c0161&ptype=0&src=9&sl=1&order=3",
"length": 0,
"order": 3,
"stream_type": 0,
"p2p_type": 0
},
{
"url": "https://d1--cn-gotcha04.bilivideo.com/live-bvc/139554/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha04&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=cf93474e923c9ba8288c45d954f81045&ptype=0&src=9&sl=1&order=4",
"length": 0,
"order": 4,
"stream_type": 0,
"p2p_type": 0
}
]
}
}
Bilibili 直播流应添加画质选项,并默认使用最低画质
参考资料:
直播间视频流
根据真实直播间号获取直播视频流
请求方式:GET
url参数:
room_id(非短号)web:http-flv方式
默认为http-flv方式
qn与quality任选其一2:流畅
3:高清
4:原画
qn与quality任选其一80:流畅
150:高清
400:蓝光
10000:原画
20000:4K
30000:杜比
json回复:
根对象:
-400:参数错误
19002003:房间信息不存在
data对象:qnqualityqualityaccept_quality数组:qn画质代码1qn画质代码(n+1)quality_description数组:quality_description数组中的对象:durl数组:durl数组中的对象:注:带有转义
示例:
查询直播间
cid=14073662的直播间信息查看响应示例:
{ "code": 0, "message": "0", "ttl": 1, "data": { "current_quality": 3, "accept_quality": [ "4", "3", "2" ], "current_qn": 3, "quality_description": [ { "qn": 4, "desc": "原画" }, { "qn": 3, "desc": "高清" }, { "qn": 2, "desc": "流畅" } ], "durl": [ { "url": "https://d1--cn-gotcha04.bilivideo.com/live-bvc/601131/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha04&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=20e4ac695fbdd1d11d5dac4f93caa783&ptype=0&src=9&sl=1&order=1", "length": 0, "order": 1, "stream_type": 0, "p2p_type": 0 }, { "url": "https://d1--cn-gotcha01.bilivideo.com/live-bvc/757951/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha01&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=9deea67bb9e9c1f0fa3886a34aa09473&ptype=0&src=9&sl=1&order=2", "length": 0, "order": 2, "stream_type": 0, "p2p_type": 0 }, { "url": "https://d1--cn-gotcha04.bilivideo.com/live-bvc/982058/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha04&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=8753b270960034660184d975d86c0161&ptype=0&src=9&sl=1&order=3", "length": 0, "order": 3, "stream_type": 0, "p2p_type": 0 }, { "url": "https://d1--cn-gotcha04.bilivideo.com/live-bvc/139554/live_14073662_bs_3699814_1500.flv?cdn=cn-gotcha04&expires=1602496530&len=0&oi=1939228219&pt=&qn=150&trid=e6540d81a5d04c2ea459c46ebe77472a&sigparams=cdn,expires,len,oi,pt,qn,trid&sign=cf93474e923c9ba8288c45d954f81045&ptype=0&src=9&sl=1&order=4", "length": 0, "order": 4, "stream_type": 0, "p2p_type": 0 } ] } }