新增批量查询直播间API (#228)

* Update info.md

* Update info.md

* Update info.md

* Update info.md

* Update info.md

* Update info.md

* add user api under live folder

* Update info.md
This commit is contained in:
Tyrael
2021-08-25 02:29:24 +10:00
committed by GitHub
parent b94e389845
commit 3390ec73bd
2 changed files with 415 additions and 0 deletions

View File

@@ -310,3 +310,114 @@ curl -G 'http://api.live.bilibili.com/live_user/v1/Master/info' \
```
</details>
## 批量查询直播间状态
> https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids
*请求方式POST*
认证方式请不要在标头中添加cookie。
**正文参数:**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| uids | array | 要查询的主播mid | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0成功<br />-111csrf校验失败 |
| message | str | 错误信息 | 默认为success |
| msg | str | 错误信息 | 默认为success |
| ttl | num | 1 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| uid | str | 直播间信息 | 实际字段为主播mid |
`uid`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| area | num | 直播间分区id | |
| area_name | str | 直播间分区名 | |
| area_v2_id | num | 直播间新版分区id | |
| area_v2_name | str | 直播间新版分区名 | |
| area_v2_parent_id | num | 直播间父分区id | |
| area_v2_parent_name | str | 直播间父分区名 | |
| broadcast_type | num | 直播类型 | 0:普通直播1手机直播 |
| cover_from_user | str | 直播间封面url | |
| face | str | 主播头像url | |
| hidden_till | str | 直播间隐藏信息 | |
| keyframe | str | 直播间关键帧url | |
| live_status | num | 直播间开播状态 | 0未开播1正在直播2轮播中 |
| live_time | num | 直播持续时长 | |
| lock_till | str | 直播间封禁信息 | |
| online | num | 直播间在线人数 | |
| room_id | num | 直播间房间号 | 直播间实际房间号 |
| short_id | num | 直播间房间号 | 直播间短房间号,常见于签约主播 |
| tag_name | str | 直播间标签 | |
| tags | str | 直播间自定标签 | |
| title | str | 直播间标题 | |
| uid | num | 主播mid | |
| uname | str | 主播用户名 | |
**示例:**
查询用户`mid=194484313`的直播间信息
```shell
curl https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids \
-H "Content-Type: application/json" \
-d "{\"uids\": [194484313]}"
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "success",
"message": "success",
"data": {
"194484313": {
"title": "中元节可爱鬼来喽!",
"room_id": 6154037,
"uid": 194484313,
"online": 955261,
"live_time": 0,
"live_status": 2,
"short_id": 732,
"area": 1,
"area_name": "单机联机",
"area_v2_id": 236,
"area_v2_name": "主机游戏",
"area_v2_parent_name": "单机游戏",
"area_v2_parent_id": 6,
"uname": "Asaki大人",
"face": "https://i1.hdslb.com/bfs/face/e8f57fd6992f7d2ef6e6bcee957fb6cf6bca3d80.jpg",
"tag_name": "以撒,minecraft,饥荒,彩虹六号,东方",
"tags": "",
"cover_from_user": "https://i0.hdslb.com/bfs/live/new_room_cover/0a0a8eb5bd7fb64a036b55c748f02ad79a210ec9.jpg",
"keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe0823020500000615403721k8sp.jpg",
"lock_till": "0000-00-00 00:00:00",
"hidden_till": "0000-00-00 00:00:00",
"broadcast_type": 0
}
}
}
```
</details>