From de588edecf8bf74f49865e8df550cf00f7644fdb Mon Sep 17 00:00:00 2001 From: Sihua <827169070@qq.com> Date: Sun, 11 Oct 2020 18:04:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E9=97=B4=E4=BF=A1=E6=81=AFAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/info.md | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/live/info.md b/live/info.md index 51781dc..9dbddaa 100644 --- a/live/info.md +++ b/live/info.md @@ -71,3 +71,89 @@ curl -G 'http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld'\ ``` + +## 根据直播间号获取直播间信息 + +> https://api.live.bilibili.com/room/v1/Room/room_init?id= + +*请求方式:GET* + +**url参数:** + +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +| ------ | ---- | ----------- | ------ | ---- | +| id | num | 目标直播间号 | 必要 | | + +**json回复:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------- | ---- | -------- | --------------------------- | +| code | num | 返回值 | 0:成功
60004:直播间不存在 | +| msg | str | 错误信息 | 默认为ok | +| message | str | 错误信息 | 默认为ok | +| data | obj | 信息本体 | | + + +`data`对象: + +| 字段 | 类型 | 内容 | 备注 | +| -------------- | ---- | ------------- | ------------------------ | +| room_id | num | 直播间真实ID | | +| short_id | num | 直播间URL_ID | | +| uid | num | 用户UID | | +| need_p2p | num | 未知 | | +| is_hidden | boolean | 未知 | | +| is_locked | boolean | 未知 | | +| is_portrait | boolean | 未知 | | +| liveStatus | num | 直播状态 | 0:未开播
1:直播中 | +| hidden_till | num | 未知 | | +| lock_till | num | 未知 | | +| encrypted | boolean | 未知 | | +| pwd_verified | boolean | 未知 | | +| live_time | num | 开播时长 | | +| room_shield | num | 未知 | | +| is_sp | num | 未知 | | +| special_type | num | 未知 | | + + +**示例:** + +查询直播间`ID=76`的直播间信息 + +```shell +curl -G 'http://api.live.bilibili.com/room/v1/Room/room_init'\ +--data-urlencode 'id=76' +``` + +
+查看响应示例: + +```json +{ + "code":0, + "msg":"ok", + "message":"ok", + "data":{ + "room_id":14073662, + "short_id":76, + "uid":50333369, + "need_p2p":0, + "is_hidden":false, + "is_locked":false, + "is_portrait":false, + "live_status":1, + "hidden_till":0, + "lock_till":0, + "encrypted":false, + "pwd_verified":false, + "live_time":1602151186, + "room_shield":1, + "is_sp":0, + "special_type":0 + } +} +``` + +
\ No newline at end of file From 3a5288a5c424a5ec962ebfc56812ebeb593fe2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=80=E7=94=BB?= <827169070@qq.com> Date: Sun, 11 Oct 2020 18:07:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8B=98=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/info.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/live/info.md b/live/info.md index 9dbddaa..2143189 100644 --- a/live/info.md +++ b/live/info.md @@ -74,7 +74,7 @@ curl -G 'http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld'\ ## 根据直播间号获取直播间信息 -> https://api.live.bilibili.com/room/v1/Room/room_init?id= +> https://api.live.bilibili.com/room/v1/Room/room_init *请求方式:GET* @@ -107,7 +107,7 @@ curl -G 'http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld'\ | is_hidden | boolean | 未知 | | | is_locked | boolean | 未知 | | | is_portrait | boolean | 未知 | | -| liveStatus | num | 直播状态 | 0:未开播
1:直播中 | +| live_status | num | 直播状态 | 0:未开播
1:直播中 | | hidden_till | num | 未知 | | | lock_till | num | 未知 | | | encrypted | boolean | 未知 | | @@ -156,4 +156,4 @@ curl -G 'http://api.live.bilibili.com/room/v1/Room/room_init'\ } ``` - \ No newline at end of file +