mirror of
https://github.com/SocialSisterYi/bilibili-API-collect.git
synced 2025-01-14 22:00:07 +08:00
完善直播间视频流
This commit is contained in:
parent
3a5288a5c4
commit
d3533ddf60
127
live/live_flow.md
Normal file
127
live/live_flow.md
Normal file
@ -0,0 +1,127 @@
|
||||
# 直播间视频流
|
||||
|
||||
|
||||
|
||||
## 根据真实直播间号获取直播视频流
|
||||
|
||||
> https://api.live.bilibili.com/room/v1/Room/playUrl
|
||||
|
||||
*请求方式:GET*
|
||||
|
||||
**url参数:**
|
||||
|
||||
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
||||
| ------ | ---- | ----------- | ------ | ---- |
|
||||
| cid | num | 目标真实直播间号 | 必要 | 为直播间的room_id号 |
|
||||
| quality | num | 画质等级 | 非必要 | 画质选择,4为最高画质,qn和quality参数二选一 |
|
||||
| platform | str | 直播流格式 | 非必要 | h5为m3u8格式,web为flv格式,默认为flv格式 |
|
||||
| qn | str | 画质等级 | 非必要 | 可选参数为1000、150、80,qn和quality参数二选一 |
|
||||
|
||||
**json回复:**
|
||||
|
||||
根对象:
|
||||
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| ------- | ---- | -------- | --------------------------- |
|
||||
| code | num | 返回值 | 0:成功<br />-400:参数错误 |
|
||||
| message | str | 错误信息 | 默认为0 |
|
||||
| ttl | str | 1 | |
|
||||
| data | obj | 信息本体 | |
|
||||
|
||||
|
||||
`data`对象:
|
||||
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| -------------- | ---- | ------------- | ------------------------ |
|
||||
| current_quality | num | 可选画质数量 | |
|
||||
| accept_quality | obj | 可选画质数参数 | |
|
||||
| current_qn | num | 可选画质数量 | |
|
||||
| quality_description | obj | 可选画质参数 | |
|
||||
| durl | obj | 直播流url | |
|
||||
|
||||
`durl`对象:
|
||||
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| -------------- | ---- | ------------- | ------------------------ |
|
||||
| url | str | 直播流url | |
|
||||
| length | num | 未知 | |
|
||||
| order | num | 未知 | |
|
||||
| stream_type | num | 未知 | |
|
||||
| p2p_type | num | 未知 | |
|
||||
|
||||
|
||||
|
||||
**示例:**
|
||||
|
||||
查询直播间`CID=14073662`的直播间信息
|
||||
|
||||
```shell
|
||||
curl -G 'http://api.live.bilibili.com/room/v1/Room/room_init'\
|
||||
--data-urlencode 'id=14073662'
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>查看响应示例:</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
Loading…
Reference in New Issue
Block a user