Update action.md

添加 保护&删除弹幕
This commit is contained in:
ProgramRipper 2020-10-03 09:12:05 +08:00
parent e6176a0fcd
commit c0f641ba65

View File

@ -672,3 +672,58 @@ curl 'http://api.bilibili.com/x/dm/report/add'\
```
</details>
## 保护&删除弹幕
> http://api.bilibili.com/x/v2/dm/edit/state
*请求方式POST*
认证方式CookieSESSDATA
**正文参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | ------------------------ | -------------- | --------------------------------------------- |
| type | num | 1 | 必要 | |
| oid | num | 视频CID | 必要 | |
| dmids | nums | 弹幕dmID列表 | 必要 | 多个ID之间用`,`分隔 |
| state | num | 操作 | 必要 | 1删除弹幕<br />2弹幕保护<br />3取消保护 |
| csrf | str | CSRF Token位于cookie | Cookie方式必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0成功<br />-101账号未登录<br />-111csrf 校验失败<br />-400请求错误<br />-403访问权限不足 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 1 | |
**示例**
删除`CID=145928946`下的弹幕`35600074482384899`、`39067304918515717`、`39082777041174531`
```shell
curl 'http://api.bilibili.com/x/v2/dm/edit/state'\
--data-urlencode 'type=1'\
--data-urlencode 'oid=145928946'\
--data-urlencode 'dmids=35600074482384899,39067304918515717,39082777041174531'\
--data-urlencode 'state=1'\
--data-urlencode 'csrf=xxx'\
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code":0,
"message":"0",
"ttl":1
}
```
</details>