2020-05-03 14:23:21 +08:00
|
|
|
|
# 弹幕操作
|
|
|
|
|
|
|
|
|
|
## 发送视频弹幕
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/v2/dm/post
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| -------- | ---- | ------------------------ | ------------ | ------------------------------------------------------------ |
|
|
|
|
|
| type | num | 1 | 必要 | |
|
|
|
|
|
| oid | num | 视频CID | 必要 | |
|
|
|
|
|
| msg | str | 弹幕内容 | 必要 | 长度小于100字符 |
|
|
|
|
|
| bvid | str | 视频bvID | 必要(可选) | avID与bvID任选一个 |
|
|
|
|
|
| aid | num | 视频avID | 必要(可选) | avID与bvID任选一个 |
|
|
|
|
|
| progress | num | 弹幕出现在视频内的时间 | 非必要 | 单位为毫秒<br />默认为0 |
|
2020-07-23 00:08:20 +08:00
|
|
|
|
| color | num | 弹幕颜色设置 | 非必要 | 十进制RGB888值<br />默认为16777215(#FFFFFF)白色 |
|
|
|
|
|
| fontsize | num | 弹幕字号设置 | 非必要 | 默认为25 |
|
|
|
|
|
| pool | num | 弹幕池选择 | 非必要 | 0:普通池<br />1:字幕池<br />2:特殊池(代码/BAS弹幕)<br />默认为0 |
|
|
|
|
|
| mode | num | 弹幕类型选择 | 必要 | 1:普通弹幕<br />4:底部弹幕<br />5:顶部弹幕<br />7:高级弹幕<br />9:BAS弹幕(`pool`必须为2) |
|
2020-08-16 13:07:07 +08:00
|
|
|
|
| rnd | num | 当前时间戳*1000000 | 非必要 | **若无此项,则发送弹幕冷却时间限制为90s**<br />若有此项,则发送弹幕冷却时间限制为5s |
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-102:账号被封停<br />-111:csrf校验失败<br />-400:请求错误<br />-404:无此项<br />36700:系统升级中<br />36701:弹幕包含被禁止的内容<br />36702:弹幕长度大于100<br />36703:发送频率过快<br />36704:禁止向未审核的视频发送弹幕<br />36705:您的等级不足,不能发送弹幕<br />36706:您的等级不足,不能发送顶端弹幕<br />36707:您的等级不足,不能发送底端弹幕<br />36708:您的等级不足,不能发送彩色弹幕<br />36709:您的等级不足,不能发送高级弹幕<br />36710:您的权限不足,不能发送这种样式的弹幕<br />36711:该视频禁止发送弹幕<br />36712:level 1用户发送弹幕的最大长度为20<br />36713:稿件未付费<br />36714:弹幕发送时间不合法<br />36715:当日操作数量超过上限 |
|
2020-05-03 14:23:21 +08:00
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-05-03 14:23:21 +08:00
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
2020-06-16 23:09:49 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------- | ---- | -------- | ------------ |
|
|
|
|
|
| action | str | 空 | 作用尚不明确 |
|
|
|
|
|
| dmid | num | 弹幕dmID | |
|
|
|
|
|
| dmid_str | str | 弹幕dmID | 字串形式 |
|
|
|
|
|
| visible | bool | true | 作用尚不明确 |
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
|
|
|
|
为视频`av2`/`BV1xx411c7mD`(CID为`62131`)的5s位置发送一条弹幕`前来考古`(颜色为#FFFFFF,字号25,普通弹幕,游动弹幕)
|
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
|
|
|
|
curl 'http://api.bilibili.com/x/v2/dm/post'\
|
|
|
|
|
--data-urlencode 'type=1'\
|
|
|
|
|
--data-urlencode 'oid=62131'\
|
|
|
|
|
--data-urlencode 'msg=前来考古'\
|
|
|
|
|
--data-urlencode 'aid=2'\
|
|
|
|
|
--data-urlencode 'progress=5000'\
|
|
|
|
|
--data-urlencode 'color=16777215'\
|
|
|
|
|
--data-urlencode 'fontsize=25'\
|
|
|
|
|
--data-urlencode 'pool=0'\
|
|
|
|
|
--data-urlencode 'mode=1'\
|
|
|
|
|
--data-urlencode 'rnd=3456789987654321'\
|
|
|
|
|
--data-urlencode 'csrf=xxx'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-03 14:23:21 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"0",
|
|
|
|
|
"ttl":1,
|
|
|
|
|
"data":{
|
|
|
|
|
"action":"",
|
|
|
|
|
"dmid":32161968826613767,
|
|
|
|
|
"dmid_str":"32161968826613767",
|
|
|
|
|
"visible":true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-05-07 18:33:01 +08:00
|
|
|
|
## 撤回弹幕
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/dm/recall
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
仅能撤回自己两分钟内的弹幕,且每天只有3次机会
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ---- | ------------------------ | ------ | ---- |
|
|
|
|
|
| dmid | num | 弹幕dmID | 必要 | |
|
|
|
|
|
| cid | num | 视频CID | 必要 | |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-102:账号被封停<br />-111:csrf校验失败<br />-400:请求错误<br />-404:无此项<br />36301:撤回失败,弹幕发送已过2分钟<br />36302:撤回失败,弹幕已经被删除或撤回<br />36303:撤回失败,今天撤回的机会已经用完<br />36304:撤回失败,服务器出错 |
|
2020-05-07 18:33:01 +08:00
|
|
|
|
| message | str | 错误信息 | 成功后显示剩余次数 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
撤回`CID=168901231`下的弹幕`32310301474947077`的弹幕
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
|
|
|
|
curl 'http://api.bilibili.com/x/dm/recall'\
|
|
|
|
|
--data-urlencode 'cid=168901231'\
|
|
|
|
|
--data-urlencode 'dmid=32310301474947077'\
|
|
|
|
|
--data-urlencode 'csrf=xxx'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-07 18:33:01 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "撤回成功,你还有3次撤回机会"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-05-10 18:25:23 +08:00
|
|
|
|
## 购买高级弹幕发送权限
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/dm/adv/buy
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
|
|
|
|
购买一次需要2硬币,同时向up主发送请求
|
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
2020-07-09 16:34:50 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ---- | ------------------------ | ------ | ---- |
|
|
|
|
|
| mode | str | sp | 必要 | |
|
|
|
|
|
| cid | num | 视频CID | 必要 | |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-102:账号被封停<br />-111:csrf校验失败<br />-107:硬币不足<br />-400:请求错误<br />36007:不允许购买<br />36009:正在确认中<br />36010:已购买 |
|
2020-05-10 18:25:23 +08:00
|
|
|
|
| message | str | 返回信息 | |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
|
|
|
|
购买视频CID为`168901231`的高级弹幕发送权限
|
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
|
|
|
|
curl 'http://api.bilibili.com/x/dm/adv/buy'\
|
|
|
|
|
--data-urlencode 'cid=168901231'\
|
|
|
|
|
--data-urlencode 'mode=sp'\
|
|
|
|
|
--data-urlencode 'csrf=xxx'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-10 18:25:23 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"已成功购买"
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
|
|
|
|
|
2020-05-10 18:25:23 +08:00
|
|
|
|
## 检测高级弹幕发送权限
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/dm/adv/state
|
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:GET*
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
**url参数:**
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ---- | ------- | ------ | ---- |
|
2020-06-08 22:44:46 +08:00
|
|
|
|
| mode | str | sp | 必要 | |
|
|
|
|
|
| cid | num | 视频CID | 必要 | |
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
2020-05-10 18:25:23 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ----------------------------- | ---------------- | -------------------------------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />--400:请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| ttl | num | 1 | |
|
2020-05-10 18:25:23 +08:00
|
|
|
|
| data | 有效时:obj<br />无效时:null | 有效时:信息本体 | |
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | ---------------- | ------------------------------------------ |
|
|
|
|
|
| coins | num | 需要支付的硬币数 | |
|
|
|
|
|
| confirm | num | 是否同意 | 1:同意<br />2:未同意<br />未购买时无此项 |
|
2020-07-17 23:50:28 +08:00
|
|
|
|
| accept | bool | 是否允许申请 | true:允许<br />false:不允许 |
|
2020-05-09 20:57:11 +08:00
|
|
|
|
| hasBuy | bool | 是否已购买 | true:已购买<br />未购买时无此项 |
|
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
|
|
|
|
查询视频CID为`168901231`的视频高级弹幕权限购买状态
|
|
|
|
|
|
|
|
|
|
当前状态为已购买且同意
|
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
|
|
|
|
curl -G 'http://api.bilibili.com/x/dm/adv/state'\
|
|
|
|
|
--data-urlencode 'cid=168901231'\
|
|
|
|
|
--data-urlencode 'mode=sp'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
2020-05-09 20:57:11 +08:00
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"coins": 2,
|
|
|
|
|
"confirm": 1,
|
|
|
|
|
"accept": true,
|
|
|
|
|
"hasBuy": true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2020-08-31 16:37:38 +08:00
|
|
|
|
</details>
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
## 查询弹幕点赞数
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/v2/dm/thumbup/stats
|
|
|
|
|
|
|
|
|
|
*请求方式:GET*
|
|
|
|
|
|
|
|
|
|
认证方式:Cookie(SESSDATA)
|
|
|
|
|
|
|
|
|
|
**url参数:**
|
2020-10-02 18:46:00 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------ | ---- | -------- | ------ | ---- |
|
|
|
|
|
| oid | num | 视频CID | 必要 | |
|
|
|
|
|
| ids | num | 弹幕dmID | 必要 | |
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
**json回复**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-400:请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------- | ---- | -------- | ---- |
|
|
|
|
|
| {弹幕ID} | obj | 套了个娃 | |
|
|
|
|
|
|
|
|
|
|
`{弹幕ID}`对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| likes | num | 点赞数 | |
|
2020-10-02 18:46:00 +08:00
|
|
|
|
| user_like | num | 是否点赞 | 0:未点赞<br />1:已点赞<br />需要登录(Cookie) <br />未登录为0 |
|
2020-10-02 17:22:12 +08:00
|
|
|
|
| id_str | str | 弹幕dmID | |
|
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
|
|
|
|
查询`CID=145928946`下的弹幕`35600074482384899`点赞数
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl -G 'http://api.bilibili.com/x/v2/dm/thumbup/stats'\
|
|
|
|
|
--data-urlencode 'oid=145928946'\
|
|
|
|
|
--data-urlencode 'ids=35600074482384899'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"0",
|
|
|
|
|
"ttl":1,
|
|
|
|
|
"data":{
|
|
|
|
|
"35600074482384899":{
|
|
|
|
|
"likes":1,
|
|
|
|
|
"user_like":1,
|
|
|
|
|
"id_str":"35600074482384899"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
## 点赞弹幕
|
|
|
|
|
|
2020-10-02 19:24:06 +08:00
|
|
|
|
> http://api.bilibili.com/x/v2/dm/thumbup/add
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
|
|
|
|
认证方式:Cookie(SESSDATA)
|
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| -------- | ---- | ------------------------ | ------ | ------------------------ |
|
|
|
|
|
| dmid | num | 弹幕dmID | 必要 | |
|
|
|
|
|
| oid | num | 视频CID | 必要 | |
|
|
|
|
|
| op | num | 操作 | 必要 | 1:点赞<br />2:取消点赞 |
|
|
|
|
|
| platform | str | 平台 | 非必要 | |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf 校验失败<br />-400:请求错误<br />65004:取消赞失败 未点赞过<br />65006:已赞过 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| tll | num | 1 | |
|
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
|
|
|
|
为`CID=145928946`下的弹幕`35600074482384899`点赞
|
|
|
|
|
|
|
|
|
|
```shell
|
2020-10-02 19:24:06 +08:00
|
|
|
|
curl 'http://api.bilibili.com/x/v2/dm/thumbup/add'\
|
2020-10-02 18:46:00 +08:00
|
|
|
|
--data-urlencode 'dmid=35600074482384899'\
|
|
|
|
|
--data-urlencode 'oid=145928946'\
|
|
|
|
|
--data-urlencode 'op=1'\
|
|
|
|
|
--data-urlencode 'platform=web_player'\
|
|
|
|
|
--data-urlencode 'csrf=xxx'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"0",
|
|
|
|
|
"ttl":1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-10-02 19:24:06 +08:00
|
|
|
|
|
|
|
|
|
## 举报弹幕
|
|
|
|
|
|
|
|
|
|
> http://api.bilibili.com/x/dm/report/add
|
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
|
|
|
|
认证方式:Cookie(SESSDATA)
|
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ------- | ---- | ------------------------ | ------ | ------------------ |
|
|
|
|
|
| cid | num | 视频CID | 必要 | |
|
|
|
|
|
| dmid | num | 弹幕dmID | 必要 | |
|
|
|
|
|
| reason | num | 举报类型 | 必要 | **类型代码见下表** |
|
|
|
|
|
| content | str | 其他举报备注 | 非必要 | `reason=11`时有效 |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
|
|
|
|
|
|
|
|
|
举报类型`reason`:
|
|
|
|
|
|
|
|
|
|
| 代码 | 含义 |
|
|
|
|
|
| ---- | ---------- |
|
|
|
|
|
| 1 | 违法违禁 |
|
|
|
|
|
| 2 | 色情低俗 |
|
|
|
|
|
| 3 | 赌博诈骗 |
|
|
|
|
|
| 4 | 人身攻击 |
|
|
|
|
|
| 5 | 侵犯隐私 |
|
|
|
|
|
| 6 | 垃圾广告 |
|
|
|
|
|
| 7 | 引战 |
|
|
|
|
|
| 8 | 剧透 |
|
|
|
|
|
| 9 | 恶意刷屏 |
|
|
|
|
|
| 10 | 视频无关 |
|
|
|
|
|
| 11 | 其他 |
|
|
|
|
|
| 12 | 青少年不良 |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf 校验失败<br />-400:请求错误<br />36201:举报弹幕不存在<br />36203:举报原因类型错误<br />36204:已举报 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| tll | num | 1 | 举报失败时 |
|
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
|
|
|
|
举报`CID=145928946`下的弹幕`35600074482384899`,理由是`引战`
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl 'http://api.bilibili.com/x/dm/report/add'\
|
|
|
|
|
--data-urlencode 'cid=145928946'\
|
|
|
|
|
--data-urlencode 'dmid=35600074482384899'\
|
|
|
|
|
--data-urlencode 'reason=7'\
|
|
|
|
|
--data-urlencode 'csrf=xxx'\
|
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":""
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|