返回提交历史
Modified
docs/live/manage.md
+195
-164
XFEstudio/bilibili-API-collect
更新直播间管理文档,更新开关播响应信息
重命名 更新直播间标题 → 更新直播间信息 删除 编辑直播间标签 将“编辑直播间标签”的内容合并到“更新直播间信息” https://github.com/SocialSisterYi/bilibili-API-collect/issues/1277
3a2c9ce
代码差异
1 个文件
+195
-164
@@ -78,7 +78,7 @@ curl 'https://api.live.bilibili.com/xlive/app-blink/v1/preLive/CreateRoom' \
78
78
79
79
80
80
81
## 更新直播间标题
81
## 更新直播间信息
82
82
83
83
> https://api.live.bilibili.com/room/v1/Room/update
84
84
@@ -92,10 +92,15 @@ curl 'https://api.live.bilibili.com/xlive/app-blink/v1/preLive/CreateRoom' \
92
92
93
93
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
94
94
| ------- | ---- | ------------------------ | ------ | -------------------- |
95
| room_id | num | 直播间id | 必要 | 必须为自己的直播间id |
96
| title | str | 直播间标题 | | 最大20字符 |
97
95
| csrf | str | CSRF Token(位于cookie) | 必要 | |
98
| csrf_token | str | CSRF Token(位于 cookie) | | |
96
| csrf_token | str | CSRF Token(位于 cookie) | 非必要 | |
97
| platform | str | 平台标识 | 非必要 | |
98
| visit_id | str | (?) | 非必要 | 某种标识? |
99
| room_id | num | 直播间id | 必要 | 必须为自己的直播间id |
100
| title | str | 直播间标题 | 非必要 | 上限40个字符 |
101
| area\_id | num | 直播分区id(子分区id) | 非必要 | 详见[直播分区](live_area.md) |
102
| add\_tag | str | 要添加的标签 | 非必要 | 开播设置界面上限10个字符 |
103
| del\_tag | str | 要删除的标签 | 非必要 | 若存在`add_tag`时不起作用 |
99
104
100
105
**json回复:**
101
106
@@ -103,10 +108,26 @@ curl 'https://api.live.bilibili.com/xlive/app-blink/v1/preLive/CreateRoom' \
103
108
104
109
| 字段 | 类型 | 内容 | 备注 |
105
110
| ------- | ------ | -------- | ------------------------------------------------------ |
106
| code | num | 返回值 | 0:成功<br />65530:token错误(登录错误)<br />1:错误 |
111
| code | num | 返回值 | 0:成功<br />-1:操作太频繁<br />1:错误<br />3:未登录或鉴权失败<br />405:不允许的请求方法<br />60009:分区已下线<br />65530:token错误(登录错误)<br /> |
107
112
| msg | str | 错误信息 | 默认为ok |
108
113
| message | str | 错误信息 | 默认为ok |
109
| data | array | 空 | |
114
| data | obj | 信息本体 | 部分失败情况下是`[]`(空数组) |
115
116
`data`对象:
117
118
| 字段 | 类型 | 内容 | 备注 |
119
| --------------- | ---- | ---- | ---- |
120
| sub_session_key | str | 信息变动标识 | |
121
| audit_info | obj | 标题审核信息 | |
122
123
`data`中的`audit_info`对象:
124
125
| 字段 | 类型 | 内容 | 备注 |
126
| ------------------ | ---- | ---- | ---- |
127
| audit_title_reason | str | 标题审核提示 | |
128
| audit_title_status | num | 标题审核状态 | |
129
| audit_title | str | 被审核的标题 | 更新标题时存在 |
130
| update_title | str | `""` | 作用尚不明确 |
110
131
111
132
**示例:**
112
133
@@ -114,10 +135,10 @@ curl 'https://api.live.bilibili.com/xlive/app-blink/v1/preLive/CreateRoom' \
114
135
115
136
```shell
116
137
curl 'https://api.live.bilibili.com/room/v1/Room/update' \
117
-b 'SESSDATA=xxx;bili_jct=xx'
138
--data-urlencode 'room_id=10352053' \
139
--data-urlencode 'title=测试' \
140
--data-urlencode 'csrf=xxx' \
141
-b 'SESSDATA=xxx;bili_jct=xx'
118
142
```
119
143
120
144
<details>
@@ -125,10 +146,111 @@ curl 'https://api.live.bilibili.com/room/v1/Room/update' \
125
146
126
147
```json
127
148
{
128
"code": 0,
129
"msg": "ok",
130
"message": "ok",
131
"data": []
149
"code":0,
150
"msg":"ok",
151
"message":"ok",
152
"data":{
153
"sub_session_key":"",
154
"audit_info":{
155
"audit_title_reason":"先发后审",
156
"update_title":"",
157
"audit_title_status":2,
158
"audit_title":"测试"
159
}
160
}
161
}
162
```
163
164
</details>
165
166
修改直播间`10352053`分区为`40`
167
168
```shell
169
curl 'https://api.live.bilibili.com/room/v1/Room/update' \
170
--data-urlencode 'room_id=10352053' \
171
--data-urlencode 'area_id=40' \
172
--data-urlencode 'csrf=xxx' \
173
-b 'SESSDATA=xxx;bili_jct=xx'
174
```
175
176
<details>
177
<summary>查看响应示例:</summary>
178
179
```json
180
{
181
"code": 0,
182
"msg": "ok",
183
"message": "ok",
184
"data": {
185
"sub_session_key": "",
186
"audit_info": {
187
"audit_title_reason": "",
188
"update_title": "",
189
"audit_title_status": 0
190
}
191
}
192
}
193
```
194
195
</details>
196
197
给直播间`11996900`添加一个标签为`测试标签`
198
199
```shell
200
curl 'https://api.live.bilibili.com/room/v1/Room/update' \
201
--data-urlencode 'room_id=11996900' \
202
--data-urlencode 'add_tag=测试标签' \
203
--data-urlencode 'csrf=xxx' \
204
-b 'SESSDATA=xxx;bili_jct=xxx'
205
```
206
207
<details>
208
<summary>查看响应示例:</summary>
209
210
```json
211
{
212
"code": 0,
213
"msg": "ok",
214
"message": "ok",
215
"data": {
216
"sub_session_key": "",
217
"audit_info": {
218
"audit_title_reason": "",
219
"update_title": "",
220
"audit_title_status": 0
221
}
222
}
223
}
224
```
225
226
</details>
227
228
给直播间`11996900`删除内容为`测试标签`的标签
229
230
```shell
231
curl 'https://api.live.bilibili.com/room/v1/Room/update' \
232
--data-urlencode 'room_id=11996900' \
233
--data-urlencode 'del_tag=测试标签' \
234
--data-urlencode 'csrf=xxx' \
235
-b 'SESSDATA=xxx;bili_jct=xxx'
236
```
237
238
<details>
239
<summary>查看响应示例:</summary>
240
241
```json
242
{
243
"code": 0,
244
"msg": "ok",
245
"message": "ok",
246
"data": {
247
"sub_session_key": "",
248
"audit_info": {
249
"audit_title_reason": "",
250
"update_title": "",
251
"audit_title_status": 0
252
}
253
}
132
254
}
133
255
```
134
256
@@ -152,7 +274,7 @@ curl 'https://api.live.bilibili.com/room/v1/Room/update' \
152
274
| -------- | ---- | ------------------------ | ------ | ----------------------------------- |
153
275
| room_id | num | 直播间id | 必要 | 必须为自己的直播间id |
154
276
| area_v2 | num | 直播分区id(子分区id) | 必要 | 详见[直播分区](live_area.md) |
155
| platform | str | 直播平台 | 必要 | 直播姬(pc):pc_link<br />web端:<br />bililink:android_link |
277
| platform | str | 直播平台 | 必要 | 直播姬(pc):pc_link<br />web在线直播:web_link<br />bililink:android_link |
156
278
| csrf | str | CSRF Token(位于cookie) | 必要 | |
157
279
158
280
**json回复:**
@@ -171,13 +293,19 @@ curl 'https://api.live.bilibili.com/room/v1/Room/update' \
171
293
| 字段 | 类型 | 内容 | 备注 |
172
294
| --------- | ----- | ---------------- | ---------------------- |
173
295
| change | num | 是否改变状态 | 0:未改变<br />1:改变 |
174
| status | str | LIVE | |
296
| status | str | 直播间状态 | `LIVE` |
175
297
| room_type | num | 0 | 作用尚不明确 |
176
298
| rtmp | obj | RTMP推流地址信息 | |
177
299
| protocols | array | ??? | 作用尚不明确 |
178
300
| try_time | str | ??? | 作用尚不明确 |
179
| live_key | str | ??? | 作用尚不明确 |
301
| live_key | str | 标记直播场次的key | |
302
| sub_session_key | str | 信息变动标识 | |
180
303
| notice | obj | ??? | 作用尚不明确 |
304
| qr | str | `""` | 作用尚不明确 |
305
| need_face_auth | bool | 需要人脸识别? | 作用尚不明确 |
306
| service_source | str | ??? | 作用尚不明确 |
307
| rtmp\_backup | null | ??? | 作用尚不明确 |
308
| up_stream_extra | obj | 主播推流额外信息? | |
181
309
182
310
`data`中的`rtmp`对象:
183
311
@@ -215,6 +343,12 @@ curl 'https://api.live.bilibili.com/room/v1/Room/update' \
215
343
| button_text | str | 空 | 作用尚不明确 |
216
344
| button_url | str | 空 | 作用尚不明确 |
217
345
346
`data`中的`up_stream_extra`对象:
347
348
| 字段 | 类型 | 内容 | 备注 |
349
| --- | --- | --- | --- |
350
| isp | str | 主播的互联网服务提供商 | |
351
218
352
**示例:**
219
353
220
354
以`27`作为分区id开播直播间`10352053`
@@ -237,39 +371,47 @@ curl 'https://api.live.bilibili.com/room/v1/Room/startLive' \
237
371
238
372
```json
239
373
{
240
"code": 0,
241
"msg": "",
242
"message": "",
243
"data": {
244
"change": 1,
245
"status": "LIVE",
246
"room_type": 0,
247
"rtmp": {
248
"addr": "rtmp://txy.live-send.acg.tv/live-txy/",
249
"code": "?streamname=live_293793435_1567354&key=***",
250
"new_link": "http://tcdns.myqcloud.com:8086/bilibili_redirect?up_rtmp=txy.live-send.acg.tv%2Flive-txy%2F%3Fstreamname%3Dlive_293793435_1567354%26key%3D***",
251
"provider": "txy"
252
},
253
"protocols": [
254
{
255
"protocol": "rtmp",
256
"addr": "rtmp://txy.live-send.acg.tv/live-txy/",
257
"code": "?streamname=live_293793435_1567354&key=***",
258
"new_link": "http://tcdns.myqcloud.com:8086/bilibili_redirect?up_rtmp=txy.live-send.acg.tv%2Flive-txy%2F%3Fstreamname%3Dlive_293793435_1567354%26key%3D***",
259
"provider": "txy"
260
}
261
],
262
"try_time": "0000-00-00 00:00:00",
263
"live_key": "l:one:live:record:10352053:1589344980",
264
"notice": {
265
"type": 1,
266
"status": 0,
267
"title": "",
268
"msg": "",
269
"button_text": "",
270
"button_url": ""
271
}
374
"code": 0,
375
"data":{
376
"change": 1,
377
"status": "LIVE",
378
"try_time": "0000-00-00 00:00:00",
379
"room_type": 0,
380
"live_key": "608336837537435443",
381
"sub_session_key": "608336837537435443sub_time:1747292297",
382
"rtmp":{
383
"type": 1,
384
"addr": "rtmp://live-push.bilivideo.com/live-bvc/",
385
"code": "?streamname=live_348892132_32373699\u0026key=e03061d4a7529d8eaa322dc4d330ca1c\u0026schedule=rtmp\u0026pflag=11",
386
"new_link": "https://core.bilivideo.com/video/uplinkcore/selfbuild/schedule?up_rtmp=live-push.bilivideo.com%2Flive-bvc%2F%3Fstreamname%3Dlive_348892132_32373699%26key%3De73061d8a7539d8eaa233dc4d880ca1c%26schedule%3Drtmp%26pflag%3D11\u0026edge=edge",
387
"provider": "live"
388
},
389
"protocols":[
390
{
391
"protocol": "rtmp",
392
"addr": "rtmp://live-push.bilivideo.com/live-bvc/","code":"?streamname=live_348892132_32373699\u0026key=e73061d4a1002d8eaa322dc4d880ca1c\u0026schedule=rtmp\u0026pflag=11",
393
"new_link": "https://core.bilivideo.com/video/uplinkcore/selfbuild/schedule?up_rtmp=live-push.bilivideo.com%2Flive-bvc%2F%3Fstreamname%3Dlive_348892132_32373699%26key%3De10298d4a7539d8eaa322dc4d220ca1c%26schedule%3Drtmp%26pflag%3D11\u0026edge=edge",
394
"provider": "txy"
395
}
396
],
397
"notice":{
398
"type": 1,
399
"status": 0,
400
"title": "",
401
"msg": "",
402
"button_text": "",
403
"button_url": ""
404
},
405
"qr": "",
406
"need_face_auth": false,
407
"service_source": "live-streaming",
408
"rtmp_backup": null,
409
"up_stream_extra":{
410
"isp": "电信"
272
411
}
412
},
413
"message": "",
414
"msg": ""
273
415
}
274
416
```
275
417
@@ -308,7 +450,7 @@ curl 'https://api.live.bilibili.com/room/v1/Room/startLive' \
308
450
| 字段 | 类型 | 内容 | 备注 |
309
451
| ------ | ---- | ------------ | ---------------------- |
310
452
| change | num | 是否改变状态 | 0:未改变<br />1:改变 |
311
| status | str | PREPARING | |
453
| status | str | 直播间状态 | `PREPARING`、`ROUND` |
312
454
313
455
**示例:**
314
456
@@ -316,9 +458,9 @@ curl 'https://api.live.bilibili.com/room/v1/Room/startLive' \
316
458
317
459
```shell
318
460
curl 'https://api.live.bilibili.com/room/v1/Room/stopLive' \
319
-b 'SESSDATA=xxx;bili_jct=xxx'
461
--data-urlencode 'room_id=10352053' \
462
--data-urlencode 'csrf=xxx' \
463
-b 'SESSDATA=xxx;bili_jct=xxx'
320
464
```
321
465
322
466
<details>
@@ -397,114 +539,3 @@ curl 'https://api.live.bilibili.com/xlive/app-blink/v1/index/updateRoomNews' \
397
539
```
398
540
399
541
</details>
400
401
## 编辑直播间标签
402
403
> https://api.live.bilibili.com/room/v1/Room/update
404
405
*请求方式:POST*
406
407
认证方式:Cookie(SESSDATA)
408
409
鉴权方式:Cookie中`bili_jct`的值正确并与`csrf`相同
410
411
**正文参数( application/x-www-form-urlencoded ):**
412
413
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
414
| ------- | ---- | ------------------------ | ------ | -------------------- |
415
| room_id | num | 直播间id | 必要 | 必须为自己的直播间id |
416
| add_tag | str | 要添加的标签 | 必要 | 最大10个字符 |
417
| del_tag | str | 要删除的标签 | 必要 | |
418
| csrf | str | CSRF Token(位于cookie) | 必要 | |
419
| csrf_token | str | CSRF Token(位于 cookie) | | |
420
421
**json回复:**
422
423
根对象:
424
425
| 字段 | 类型 | 内容 | 备注 |
426
| ------- | ---- | -------- | ------------------------------------------------------ |
427
| code | num | 返回值 | 0:成功<br />65530:token错误(登录错误)<br />1:错误 |
428
| data | obj | | |
429
| message | str | 错误信息 | 默认为ok |
430
| msg | str | 错误信息 | 默认为ok |
431
432
`data`对象:
433
434
| 字段 | 类型 | 内容 | 备注 |
435
| --------------- | ---- | ---- | ---- |
436
| audit_info | obj | | |
437
| sub_session_key | str | | |
438
439
`data`中的`audit_info`对象:
440
441
| 字段 | 类型 | 内容 | 备注 |
442
| ------------------ | ---- | ---- | ---- |
443
| audit_title_reason | str | | |
444
| audit_title_status | num | 0 | |
445
| update_title | str | | |
446
447
**示例:**
448
449
给直播间`11996900`添加一个标签为`测试标签`
450
451
```shell
452
curl 'https://api.live.bilibili.com/room/v1/Room/update' \
453
-b 'SESSDATA=xxx;bili_jct=xxx'
454
```
455
456
<details>
457
<summary>查看响应示例:</summary>
458
459
```json
460
{
461
"code": 0,
462
"msg": "ok",
463
"message": "ok",
464
"data": {
465
"sub_session_key": "",
466
"audit_info": {
467
"audit_title_reason": "",
468
"update_title": "",
469
"audit_title_status": 0
470
}
471
}
472
}
473
```
474
</details>
475
476
给直播间`11996900`删除内容为`测试标签`的标签
477
478
```shell
479
curl 'https://api.live.bilibili.com/room/v1/Room/update' \
480
-b 'SESSDATA=xxx;bili_jct=xxx'
481
```
482
483
<details>
484
<summary>查看响应示例:</summary>
485
486
```json
487
{
488
"code": 0,
489
"msg": "ok",
490
"message": "ok",
491
"data": {
492
"sub_session_key": "",
493
"audit_info": {
494
"audit_title_reason": "",
495
"update_title": "",
496
"audit_title_status": 0
497
}
498
}
499
}
500
```
501
502
</details>