2020-05-03 14:23:21 +08:00
|
|
|
|
# 弹幕操作
|
|
|
|
|
|
2020-11-20 20:13:12 +08:00
|
|
|
|
- [发送视频弹幕](#发送视频弹幕)
|
|
|
|
|
- [发送互动弹幕](#发送互动弹幕)
|
|
|
|
|
- [撤回弹幕](#撤回弹幕)
|
|
|
|
|
- [购买高级弹幕发送权限](#购买高级弹幕发送权限)
|
|
|
|
|
- [检测高级弹幕发送权限](#检测高级弹幕发送权限)
|
|
|
|
|
- [查询弹幕点赞数](#查询弹幕点赞数)
|
|
|
|
|
- [点赞弹幕](#点赞弹幕)
|
|
|
|
|
- [举报弹幕](#举报弹幕)
|
|
|
|
|
- [保护&删除弹幕](#保护&删除弹幕)
|
|
|
|
|
- [修改字幕池](#修改字幕池)
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2020-05-03 14:23:21 +08:00
|
|
|
|
## 发送视频弹幕
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/v2/dm/post
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-10-03 00:53:53 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-10-04 23:46:02 +08:00
|
|
|
|
此接口与漫画弹幕相同
|
|
|
|
|
|
|
|
|
|
`mode=6`的逆向弹幕与`mode=8`的代码弹幕不可发送
|
|
|
|
|
|
2020-06-08 22:44:46 +08:00
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
2020-10-04 23:46:02 +08:00
|
|
|
|
| type | num | 弹幕类选择 | 必要 | 1:视频弹幕 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| oid | num | 视频cid | 必要 | |
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| msg | str | 弹幕内容 | 必要 | 长度小于100字符 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| bvid | str | 稿件bvid | 必要(可选) | avid与bvid任选一个 |
|
|
|
|
|
| aid | num | 稿件avid | 必要(可选) | avid与bvid任选一个 |
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| progress | num | 弹幕出现在视频内的时间 | 非必要 | 单位为毫秒<br />默认为0 |
|
|
|
|
|
| color | num | 弹幕颜色设置 | 非必要 | 十进制RGB888值<br />默认为16777215(#FFFFFF)白色 |
|
|
|
|
|
| fontsize | num | 弹幕字号设置 | 非必要 | 默认为25<br />极小:12<br />超小:16<br />小:18<br />标准:25<br />大:36<br />超大:45<br />极大:64 |
|
|
|
|
|
| pool | num | 弹幕池选择 | 非必要 | 0:普通池<br />1:字幕池<br />2:特殊池(代码/BAS弹幕)<br />默认为0 |
|
|
|
|
|
| mode | num | 弹幕类型选择 | 必要 | 1:普通弹幕<br />4:底部弹幕<br />5:顶部弹幕<br />7:高级弹幕<br />9:BAS弹幕(`pool`必须为2) |
|
|
|
|
|
| rnd | num | 当前时间戳*1000000 | 非必要 | **若无此项,则发送弹幕冷却时间限制为90s**<br />若有此项,则发送弹幕冷却时间限制为5s |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 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 | 空 | 作用尚不明确 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| dmid | num | 弹幕dmid | |
|
|
|
|
|
| dmid_str | str | 弹幕dmid | 字串形式 |
|
2020-06-16 23:09:49 +08:00
|
|
|
|
| visible | bool | true | 作用尚不明确 |
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
为视频`av2`/`BV1xx411c7mD`(cid为`62131`)的5000ms位置发送一条弹幕`前来考古`(颜色为#FFFFFF,字号25,普通弹幕,游动弹幕)
|
2020-05-03 14:23:21 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/post' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--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' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
-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-10-02 19:49:54 +08:00
|
|
|
|
## 发送互动弹幕
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/v2/dm/command/post
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
|
|
|
|
|
|
|
|
|
2020-09-25 B站更新了互动弹幕功能,包括UP主头像弹幕、关联视频弹幕、视频内嵌引导关注按钮三大功能
|
|
|
|
|
|
|
|
|
|
详情见:
|
|
|
|
|
|
|
|
|
|
[【客户端更新】6.10版本更新!UP主支持发布关联视频弹幕]( https://www.bilibili.com/read/cv7728299 )
|
|
|
|
|
|
|
|
|
|
[引导关注卡片]( https://www.bilibili.com/blackboard/activity-c8a0iDRQy.html )
|
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
|
|
|
|
| type | num | 互动弹幕类型 | 必要 | 1:UP主头像弹幕<br />2:关联视频弹幕<br />5:视频内嵌引导关注按钮 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| aid | num | 稿件avid | 必要 | |
|
|
|
|
|
| cid | num | 视频cid | 必要 | |
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| progress | num | 弹幕出现在视频内的时间 | 非必要 | 单位为毫秒<br />默认为0 |
|
|
|
|
|
| plat | num | 平台标识 | 必要 | 1:web端<br />2:安卓端<br />8:视频管理页面 |
|
|
|
|
|
| data | str | json序列 | 必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| dmid | num | 修改互动弹幕的弹幕id | 非必要 | 注:修改弹幕`plat`必须为8 |
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | Cookie方式必要 | |
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
2020-10-04 23:46:02 +08:00
|
|
|
|
`data`参数json序列:
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
类型为【UP主头像弹幕】时:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | -------- | ---- |
|
|
|
|
|
| msg | str | 弹幕内容 | |
|
|
|
|
|
|
|
|
|
|
类型为【关联视频弹幕】时:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | -------------- | ---- |
|
|
|
|
|
| msg | str | 弹幕内容 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| bvid | str | 关联视频的bvid | |
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
类型为【视频内嵌引导关注按钮】时:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------- | ---- | -------- | --------------- |
|
|
|
|
|
| duration | num | 持续时间 | 单位为毫秒 |
|
|
|
|
|
| posX | num | X坐标 | 区间:[118-549] |
|
|
|
|
|
| posY | num | Y坐标 | 区间:[82-293] |
|
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ----------------------------- | -------- | ------------------------------------------------------------ |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-102:账号被封停<br />-111:csrf校验失败<br />-400:请求错误<br />-404:无此项<br />-500:服务器错误<br />36711:该视频禁止发送弹幕<br />79026:发送失败,请勿填写当前稿件bvid<br />79024:发送失败,请输入正确的bvid<br />79036:该指令弹幕超出限制<br />79037:关注弹幕坐标溢出 |
|
2020-10-02 19:49:54 +08:00
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | |
|
|
|
|
|
| data | 正确时:obj<br />错误时:null | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------- | ---- | ---------------------- | ------------------------------------------------------------ |
|
|
|
|
|
| command | str | 指令? | UP主头像弹幕:#UP#<br />关联视频弹幕:#LINK#<br />视频内嵌引导关注按钮:#ATTENTION# |
|
|
|
|
|
| content | str | 弹幕内容 | |
|
|
|
|
|
| extra | str | 弹幕数据 | json序列 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| id | num | 弹幕dmid | |
|
|
|
|
|
| idStr | str | 弹幕dmid | 字串形式 |
|
|
|
|
|
| mid | num | 用户mid | |
|
|
|
|
|
| oid | num | 视频cid | |
|
2020-10-02 19:49:54 +08:00
|
|
|
|
| progress | num | 弹幕出现在视频内的时间 | |
|
|
|
|
|
| type | num | 互动弹幕类型 | 1:UP主头像弹幕<br />2:关联视频弹幕<br />5:视频内嵌引导关注按钮 |
|
|
|
|
|
|
|
|
|
|
`extra`序列数据:
|
|
|
|
|
|
|
|
|
|
类型为【UP主头像弹幕】时:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ---- | ---- | ----------- | ---- |
|
|
|
|
|
| icon | str | UP主头像url | |
|
|
|
|
|
|
|
|
|
|
类型为【关联视频弹幕】时:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ----- | ---- | -------------- | ---- |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| aid | num | 关联视频的avid | |
|
2020-10-02 19:49:54 +08:00
|
|
|
|
| title | str | 关联视频的标题 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| bvid | str | 关联视频的bvid | |
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
2020-10-04 23:46:02 +08:00
|
|
|
|
类型为【视频内嵌引导关注按钮】时:
|
|
|
|
|
|
2020-11-28 13:06:00 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------- | ---- | ------------ | ------------------------------------------ |
|
|
|
|
|
| duration | num | 持续时间 | 单位为毫秒 |
|
|
|
|
|
| posX | num | X坐标 | 区间:[118-549] |
|
|
|
|
|
| posY | num | Y坐标 | 区间:[82-293] |
|
|
|
|
|
| icon | str | 按钮图片url | 不应该是关注按钮吗,但这个是圆形的 |
|
|
|
|
|
| type | num | 关注按钮类型 | 0:仅关注<br />1:仅三联<br />2:关注+三联 |
|
2020-10-04 23:46:02 +08:00
|
|
|
|
|
2020-10-02 19:49:54 +08:00
|
|
|
|
**示例:**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
为视频`av201947622`(cid为`230709860`)的5000ms位置发送一条UP主头像弹幕`test`
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/command/post' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'type=1' \
|
|
|
|
|
--data-urlencode 'aid=201947622' \
|
|
|
|
|
--data-urlencode 'cid=230709860' \
|
|
|
|
|
--data-urlencode 'progress=5000' \
|
|
|
|
|
--data-urlencode 'plat=1' \
|
|
|
|
|
--data-urlencode 'data={"msg":"test"}' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-02 19:49:54 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"id": 39053842117558279,
|
|
|
|
|
"oid": 230709860,
|
|
|
|
|
"mid": 293793435,
|
|
|
|
|
"type": 1,
|
|
|
|
|
"command": "#UP#",
|
|
|
|
|
"content": "test",
|
|
|
|
|
"extra": "{\"icon\":\"http://i0.hdslb.com/bfs/face/aebb2639a0d47f2ce1fec0631f412eaf53d4a0be.jpg\"}",
|
|
|
|
|
"idStr": "39053842117558279"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
为视频`av201947622`(cid为`230709860`)的5000ms位置发送一条发送关联视频弹幕`测试1234`关联视频为`BV1kz4y1X7XP`
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/command/post' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'type=2' \
|
|
|
|
|
--data-urlencode 'aid=201947622' \
|
|
|
|
|
--data-urlencode 'cid=230709860' \
|
|
|
|
|
--data-urlencode 'progress=5000' \
|
|
|
|
|
--data-urlencode 'plat=1' \
|
|
|
|
|
--data-urlencode 'data={"bvid":"BV1kz4y1X7XP","msg":"测试1234"}' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-02 19:49:54 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"id": 39054383689236483,
|
|
|
|
|
"oid": 230709860,
|
|
|
|
|
"mid": 293793435,
|
|
|
|
|
"type": 2,
|
|
|
|
|
"command": "#LINK#",
|
|
|
|
|
"content": "测试1234",
|
|
|
|
|
"progress": 11925,
|
|
|
|
|
"extra": "{\"aid\":583785685,\"title\":\"【cmd】访问api 命令行也能上B站\",\"bvid\":\"BV1kz4y1X7XP\"}",
|
|
|
|
|
"idStr": "39054383689236483"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
为视频`av201947622`(cid为`230709860`)的5000ms位置发送视频内嵌引导关注按钮,X坐标为118,Y坐标为82,持续时间为5000ms
|
2020-10-02 19:49:54 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/command/post' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'type=5' \
|
|
|
|
|
--data-urlencode 'aid=201947622' \
|
|
|
|
|
--data-urlencode 'cid=230709860' \
|
|
|
|
|
--data-urlencode 'progress=5000' \
|
|
|
|
|
--data-urlencode 'plat=1' \
|
|
|
|
|
--data-urlencode 'data={"duration":5000,"posX":118,"posY":82}' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-02 19:49:54 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"id": 39055158405496839,
|
|
|
|
|
"oid": 230709860,
|
|
|
|
|
"mid": 293793435,
|
|
|
|
|
"type": 5,
|
|
|
|
|
"command": "#ATTENTION#",
|
|
|
|
|
"progress": 5000,
|
|
|
|
|
"extra": "{\"duration\":5000,\"posX\":118,\"posY\":82}",
|
|
|
|
|
"idStr": "39055158405496839"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
|
2020-05-07 18:33:01 +08:00
|
|
|
|
## 撤回弹幕
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/dm/recall
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-10-03 00:53:53 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
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-10-03 00:53:53 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | ---- |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| dmid | num | 弹幕dmid | 必要 | |
|
|
|
|
|
| cid | num | 视频cid | 必要 | |
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 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
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
撤回`cid=168901231`下的弹幕`32310301474947077`的弹幕
|
2020-05-07 18:33:01 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/dm/recall' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'cid=168901231' \
|
|
|
|
|
--data-urlencode 'dmid=32310301474947077' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
-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
|
|
|
|
## 购买高级弹幕发送权限
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/dm/adv/buy
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:POST*
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
2020-10-03 00:53:53 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
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-10-03 00:53:53 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | ---- |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
|
|
|
|
| mode | str | sp | 必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| cid | num | 视频cid | 必要 | |
|
2020-10-03 00:53:53 +08:00
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | 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
|
|
|
|
|
|
|
|
|
示例:
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
购买视频cid为`168901231`的高级弹幕发送权限
|
2020-05-10 18:25:23 +08:00
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/dm/adv/buy' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'cid=168901231' \
|
|
|
|
|
--data-urlencode 'mode=sp' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
-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
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/dm/adv/state
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
2020-07-14 18:44:44 +08:00
|
|
|
|
*请求方式:GET*
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
2020-10-03 00:53:53 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
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-10-03 00:53:53 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------ | ----------- | ---- |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
|
|
|
|
| mode | str | sp | 必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| 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 />未购买时无此项 |
|
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
查询视频cid为`168901231`的视频高级弹幕权限购买状态
|
2020-05-09 20:57:11 +08:00
|
|
|
|
|
|
|
|
|
当前状态为已购买且同意
|
|
|
|
|
|
2020-07-18 23:56:10 +08:00
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://api.bilibili.com/x/dm/adv/state' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'cid=168901231' \
|
|
|
|
|
--data-urlencode 'mode=sp' \
|
2020-07-18 23:56:10 +08:00
|
|
|
|
-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
|
|
|
|
|
|
|
|
|
## 查询弹幕点赞数
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/v2/dm/thumbup/stats
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:GET*
|
|
|
|
|
|
2020-10-02 20:25:28 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
**url参数:**
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------ | ----------- | ------------------- |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| oid | num | 视频cid | 必要 | |
|
|
|
|
|
| ids | nums | 弹幕dmid列表 | 必要 | 多个id之间用`,`分隔 |
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
**json回复**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | --------------------------- |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-400:请求错误 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | |
|
|
|
|
|
| data | obj | 信息本体 | |
|
|
|
|
|
|
|
|
|
|
`data`对象:
|
|
|
|
|
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| -------- | ---- | ---------------- | --------------------------------- |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| {弹幕id} | obj | 弹幕id对应的信息 | id分别对应请求参数中的`ids`,下同 |
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| …… | obj | 弹幕id对应的信息 | |
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
`{弹幕id}`对象:
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| --------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| likes | num | 点赞数 | |
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| user_like | num | 是否点赞 | 0:未点赞<br />1:已点赞<br />需要登录(Cookie或APP) <br />未登录恒为0 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| id_str | str | 弹幕dmid | |
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
查询`cid=236871317`下的弹幕`35600074482384899`、`38880975220375559`、`39052528418553863`点赞数
|
2020-10-02 17:22:12 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl -G 'https://api.bilibili.com/x/v2/dm/thumbup/stats' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'oid=236871317' \
|
|
|
|
|
--data-urlencode 'ids=39019145405661191,38880975220375559,39052528418553863' \
|
2020-10-02 17:22:12 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2020-10-02 20:25:28 +08:00
|
|
|
|
"code": 0,
|
|
|
|
|
"message": "0",
|
|
|
|
|
"ttl": 1,
|
|
|
|
|
"data": {
|
|
|
|
|
"38880975220375559": {
|
|
|
|
|
"likes": 1,
|
|
|
|
|
"user_like": 1,
|
|
|
|
|
"id_str": "38880975220375559"
|
|
|
|
|
},
|
|
|
|
|
"39019145405661191": {
|
|
|
|
|
"likes": 3,
|
|
|
|
|
"user_like": 1,
|
|
|
|
|
"id_str": "39019145405661191"
|
|
|
|
|
},
|
|
|
|
|
"39052528418553863": {
|
|
|
|
|
"likes": 2,
|
|
|
|
|
"user_like": 0,
|
|
|
|
|
"id_str": "39052528418553863"
|
2020-10-02 17:22:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
## 点赞弹幕
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/v2/dm/thumbup/add
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
2020-10-02 20:25:28 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | ------------------------ |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| dmid | num | 弹幕dmid | 必要 | |
|
|
|
|
|
| oid | num | 视频cid | 必要 | |
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| op | num | 操作 | 必要 | 1:点赞<br />2:取消点赞 |
|
|
|
|
|
| platform | str | 平台 | 非必要 | |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | Cookie方式必要 | |
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
2023-01-18 12:12:58 +08:00
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
|---------|-----|------|------------------------------------------------------------------------------------------------------------------------------------|
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf 校验失败<br />-400:请求错误<br />36106:该弹幕已被删除<br/>36805:该视频禁止点赞弹幕<br/>65004:取消赞失败 未点赞过<br />65006:已赞过 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| tll | num | 1 | |
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
为`cid=145928946`下的弹幕`35600074482384899`点赞
|
2020-10-02 18:46:00 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/thumbup/add' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'dmid=35600074482384899' \
|
|
|
|
|
--data-urlencode 'oid=145928946' \
|
|
|
|
|
--data-urlencode 'op=1' \
|
|
|
|
|
--data-urlencode 'platform=web_player' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-02 18:46:00 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"0",
|
|
|
|
|
"ttl":1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-10-02 19:24:06 +08:00
|
|
|
|
|
|
|
|
|
## 举报弹幕
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/dm/report/add
|
2020-10-02 19:24:06 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
2020-10-02 20:25:28 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA)或APP
|
2020-10-02 19:24:06 +08:00
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | ------------------ |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| cid | num | 视频cid | 必要 | |
|
|
|
|
|
| dmid | num | 弹幕dmid | 必要 | |
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| reason | num | 举报类型 | 必要 | **类型代码见下表** |
|
|
|
|
|
| content | str | 其他举报备注 | 非必要 | `reason=11`时有效 |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | Cookie方式必要 | |
|
2020-10-02 19:24:06 +08:00
|
|
|
|
|
|
|
|
|
举报类型`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:已举报 |
|
2020-10-02 20:25:28 +08:00
|
|
|
|
| message | str | 错误信息 | 默认为空 |
|
2020-10-02 19:24:06 +08:00
|
|
|
|
| tll | num | 1 | 举报失败时 |
|
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
举报`cid=145928946`下的弹幕`35600074482384899`,理由是`引战`
|
2020-10-02 19:24:06 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/dm/report/add' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'cid=145928946' \
|
|
|
|
|
--data-urlencode 'dmid=35600074482384899' \
|
|
|
|
|
--data-urlencode 'reason=7' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-02 19:24:06 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":""
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-10-03 09:12:05 +08:00
|
|
|
|
|
|
|
|
|
## 保护&删除弹幕
|
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/v2/dm/edit/state
|
2020-10-03 09:12:05 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
2020-10-04 23:56:18 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA) 或APP
|
|
|
|
|
|
|
|
|
|
注:只能操作自己的稿件或有骑士权限的稿件
|
2020-10-03 09:12:05 +08:00
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-10-04 23:56:18 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | --------------------------------------------- |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
|
|
|
|
| type | num | 弹幕类选择 | 必要 | 1:视频弹幕 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| oid | num | 视频cid | 必要 | |
|
|
|
|
|
| dmids | nums | 弹幕dmid | 必要 | 多个id之间用`,`分隔 |
|
2020-10-04 23:56:18 +08:00
|
|
|
|
| state | num | 操作代码 | 必要 | 1:删除弹幕<br />2:弹幕保护<br />3:取消保护 |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | Cookie方式必要 | |
|
2020-10-03 09:12:05 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf 校验失败<br />-400:请求错误<br />-403:访问权限不足 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | |
|
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
删除`cid=145928946`下的弹幕`35600074482384899`、`39067304918515717`、`39082777041174531`
|
2020-10-03 09:12:05 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/edit/state' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'type=1' \
|
|
|
|
|
--data-urlencode 'oid=145928946' \
|
|
|
|
|
--data-urlencode 'dmids=35600074482384899,39067304918515717,39082777041174531' \
|
|
|
|
|
--data-urlencode 'state=1' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-03 09:12:05 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"0",
|
|
|
|
|
"ttl":1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-10-03 09:31:18 +08:00
|
|
|
|
|
2020-10-04 23:56:18 +08:00
|
|
|
|
## 修改字幕池
|
2020-10-03 09:31:18 +08:00
|
|
|
|
|
2023-01-17 15:23:59 +08:00
|
|
|
|
> https://api.bilibili.com/x/v2/dm/edit/pool
|
2020-10-03 09:31:18 +08:00
|
|
|
|
|
|
|
|
|
*请求方式:POST*
|
|
|
|
|
|
2020-10-04 23:56:18 +08:00
|
|
|
|
认证方式:Cookie(SESSDATA) 或APP
|
|
|
|
|
|
|
|
|
|
注:只能操作自己的稿件或有骑士权限的稿件
|
2020-10-03 09:31:18 +08:00
|
|
|
|
|
|
|
|
|
**正文参数( application/x-www-form-urlencoded ):**
|
|
|
|
|
|
2020-10-04 23:56:18 +08:00
|
|
|
|
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
|
|
|
|
| ---------- | ---- | ------------------------ | -------------- | -------------------------------- |
|
|
|
|
|
| access_key | str | APP登录Token | APP方式必要 | |
|
|
|
|
|
| type | num | 弹幕类选择 | 必要 | 1:视频弹幕 |
|
2021-07-12 21:31:27 +08:00
|
|
|
|
| oid | num | 视频cid | 必要 | |
|
|
|
|
|
| dmids | nums | 弹幕dmid | 必要 | 多个id之间用`,`分隔 |
|
2020-10-04 23:56:18 +08:00
|
|
|
|
| pool | num | 操作代码 | 必要 | 0:移出字幕池<br />1:移入字幕池 |
|
|
|
|
|
| csrf | str | CSRF Token(位于cookie) | Cookie方式必要 | |
|
2020-10-03 09:31:18 +08:00
|
|
|
|
|
|
|
|
|
**json回复:**
|
|
|
|
|
|
|
|
|
|
根对象:
|
|
|
|
|
|
|
|
|
|
| 字段 | 类型 | 内容 | 备注 |
|
|
|
|
|
| ------- | ---- | -------- | ------------------------------------------------------------ |
|
|
|
|
|
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-111:csrf 校验失败<br />-400:请求错误<br />-403:访问权限不足 |
|
|
|
|
|
| message | str | 错误信息 | 默认为0 |
|
|
|
|
|
| ttl | num | 1 | |
|
|
|
|
|
|
|
|
|
|
**示例**
|
|
|
|
|
|
2021-07-12 21:31:27 +08:00
|
|
|
|
将`cid=145928946`下的弹幕`35600074482384899`、`39067304918515717`、`39082777041174531`移入字幕池
|
2020-10-03 09:31:18 +08:00
|
|
|
|
|
|
|
|
|
```shell
|
2023-01-17 15:23:59 +08:00
|
|
|
|
curl 'https://api.bilibili.com/x/v2/dm/edit/state' \
|
2020-10-16 19:31:41 +08:00
|
|
|
|
--data-urlencode 'type=1' \
|
|
|
|
|
--data-urlencode 'oid=145928946' \
|
|
|
|
|
--data-urlencode 'pool=1' \
|
|
|
|
|
--data-urlencode 'dmids=35600074482384899,39067304918515717,39082777041174531' \
|
|
|
|
|
--data-urlencode 'csrf=xxx' \
|
2020-10-03 09:31:18 +08:00
|
|
|
|
-b 'SESSDATA=xxx'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>查看响应示例:</summary>
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"code":0,
|
|
|
|
|
"message":"0",
|
|
|
|
|
"ttl":1
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|