返回提交历史
Modified
README.md
+2
-2
Added
comment/action.md
+212
-0
XFEstudio/bilibili-API-collect
添加发送评论
a38b184
代码差异
2 个文件
+214
-2
@@ -84,8 +84,8 @@
84
84
- [封禁公示](blackroom/banlist.md)√
85
85
- 仲裁信息
86
86
- [评论区](comment)
87
- [评论区明细](comment/comment_list.md)×
88
- 操作
87
- [评论区明细](comment/comment_list.md)√
88
- [操作](comment/action.md)×
89
89
- 表情
90
90
- [创作中心](creativecenter)
91
91
- [统计与数据](creativecenter/statistics&data.md)x
@@ -0,0 +1,212 @@
1
# 评论区操作
2
3
## 发表评论
4
5
> http://api.bilibili.com/x/v2/reply/add
6
7
*方式:POST*
8
9
需要登录(SESSDATA)
10
11
**正文参数( application/x-www-form-urlencoded ):**
12
13
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
14
| ------- | ---- | ------------------- | ------ | ------------------------------------------------------------ |
15
| type | num | 评论区类型代码 | 必要 | **类型代码见「[评论区明细](comment_list.md)」** |
16
| oid | num | 目标评论区ID | 必要 | |
17
| root | num | 根评论ID | 非必要 | 二级评论以上使用 |
18
| parent | num | 夫评论ID | 非必要 | 二级评论同根评论ID<br />大于二级评论为要回复的评论ID |
19
| message | str | 发送评论内容 | 必要 | 最大1000字符<br />表情使用表情转义符 |
20
| plat | num | 发送平台标识 | 非必要 | 1:web端<br />2:安卓客户端<br />3:ios客户端<br />4:wp客户端<br />默认为1 |
21
| csrf | str | cookies中的bili_jct | 必要 | |
22
23
**json回复:**
24
25
根对象:
26
27
| 字段 | 类型 | 内容 | 备注 |
28
| ------- | ----------------------------- | -------- | ------------------------------------------------------------ |
29
| code | num | 返回值 | 0:成功<br />-101:账号未登录<br />-102:账号被封停<br />-111:csrf校验失败<br />-400:请求错误<br />-404:无此项<br />12002:评论区已关闭<br />12009:评论主体的type不合法<br />12025:评论字数过多<br />**(其他错误码有待补充)** |
30
| message | str | 错误信息 | 默认为0 |
31
| ttl | num | 1 | **作用尚不明确** |
32
| data | 正确时:obj<br />错误时:null | 数据本体 | |
33
34
`data`对象:
35
36
| 字段 | 类型 | 内容 | 备注 |
37
| -------------- | ----------------------------- | -------------- | ------------------------------------------------------------ |
38
| success_action | num | 0 | **作用尚不明确** |
39
| success_toast | str | 状态文字 | |
40
| need_captcha | bool | false | **作用尚不明确** |
41
| url | str | 空 | **作用尚不明确** |
42
| rpid | num | 评论ID | |
43
| rpid_str | str | 评论ID | |
44
| dialog | num | 回复对方ID | 若为一级评论则为0<br />若为二级评论则为该评论ID<br />大于二级评论为上一级评论ID |
45
| dialog_str | str | 回复对方ID | |
46
| root | num | 根评论ID | 若为一级评论则为0<br />大于一级评论则为根评论ID |
47
| root_str | str | 根评论ID | |
48
| parent | num | 回复父评论ID | 若为一级评论则为0<br />若为二级评论则为根评论ID<br />大于二级评论为上一级评论ID |
49
| parent_str | str | 回复父评论ID | |
50
| emote | obj | 表情转义符信息 | 无表情时无此项<br />**见「[评论区明细](comment_list.md#附表-评论条目对象)」的附表** |
51
| reply | 有效时:obj<br />无效时:null | | **见「[评论区明细](comment_list.md#附表-评论条目对象)」的附表** |
52
53
**示例:**
54
55
给视频`av243322853`发送内容为`测试test[泠鸢yousa_awsl]`的评论(带有表情转义符),平台标识为1(web端)
56
57
curl -b "SESSDATA=xxx" -d "type=1&oid=243322853&message=%E6%B5%8B%E8%AF%95test%5B%E6%B3%A0%E9%B8%A2yousa_awsl%5D&plat=1&csrf=xxx" "http://api.bilibili.com/x/v2/reply/add"
58
59
```json
60
{
61
"code": 0,
62
"message": "0",
63
"ttl": 1,
64
"data": {
65
"success_action": 0,
66
"success_toast": "发送成功",
67
"need_captcha": false,
68
"url": "",
69
"rpid": 3043212039,
70
"rpid_str": "3043212039",
71
"dialog": 0,
72
"dialog_str": "0",
73
"root": 0,
74
"root_str": "0",
75
"parent": 0,
76
"parent_str": "0",
77
"emote": {
78
"[泠鸢yousa_awsl]": {
79
"id": 2086,
80
"package_id": 93,
81
"state": 0,
82
"type": 3,
83
"attr": 0,
84
"text": "[泠鸢yousa_awsl]",
85
"url": "http://i0.hdslb.com/bfs/emote/7663b729161bd4556c2ec318c07791000743eb56.png",
86
"meta": {
87
"size": 2
88
},
89
"mtime": 1589776042
90
}
91
},
92
"reply": {
93
"rpid": 3043212039,
94
"oid": 243322853,
95
"type": 1,
96
"mid": 293793435,
97
"root": 0,
98
"parent": 0,
99
"dialog": 0,
100
"count": 0,
101
"rcount": 0,
102
"state": 0,
103
"fansgrade": 0,
104
"attr": 0,
105
"ctime": 1592233764,
106
"rpid_str": "3043212039",
107
"root_str": "0",
108
"parent_str": "0",
109
"like": 0,
110
"action": 0,
111
"member": {
112
"mid": "293793435",
113
"uname": "社会易姐QwQ",
114
"sex": "男",
115
"sign": "高中技术宅一枚,爱好MC&电子&8-bit音乐&数码&编程,资深猿厨",
116
"avatar": "http://i1.hdslb.com/bfs/face/aebb2639a0d47f2ce1fec0631f412eaf53d4a0be.jpg",
117
"rank": "10000",
118
"DisplayRank": "0",
119
"level_info": {
120
"current_level": 5,
121
"current_min": 0,
122
"current_exp": 0,
123
"next_exp": 0
124
},
125
"pendant": {
126
"pid": 1888,
127
"name": "泠鸢yousa",
128
"image": "http://i0.hdslb.com/bfs/garb/item/3e66e712b8e70c6b02393c54ad5fd8d993eb39f9.png",
129
"expire": 0,
130
"image_enhance": "http://i0.hdslb.com/bfs/garb/item/3e66e712b8e70c6b02393c54ad5fd8d993eb39f9.png"
131
},
132
"nameplate": {
133
"nid": 0,
134
"name": "",
135
"image": "",
136
"image_small": "",
137
"level": "",
138
"condition": ""
139
},
140
"official_verify": {
141
"type": -1,
142
"desc": ""
143
},
144
"vip": {
145
"vipType": 2,
146
"vipDueDate": 1612454400000,
147
"dueRemark": "",
148
"accessStatus": 0,
149
"vipStatus": 1,
150
"vipStatusWarn": "",
151
"themeType": 0,
152
"label": {
153
"path": "",
154
"text": "年度大会员",
155
"label_theme": "annual_vip"
156
}
157
},
158
"fans_detail": null,
159
"following": 0,
160
"is_followed": 0,
161
"user_sailing": {
162
"pendant": {
163
"id": 1888,
164
"name": "泠鸢yousa",
165
"image": "http://i0.hdslb.com/bfs/garb/item/3e66e712b8e70c6b02393c54ad5fd8d993eb39f9.png",
166
"jump_url": "",
167
"type": "suit"
168
},
169
"cardbg": null,
170
"cardbg_with_focus": null
171
}
172
},
173
"content": {
174
"message": "测试test[泠鸢yousa_awsl]",
175
"plat": 1,
176
"device": "",
177
"members": [],
178
"emote": {
179
"[泠鸢yousa_awsl]": {
180
"id": 2086,
181
"package_id": 93,
182
"state": 0,
183
"type": 3,
184
"attr": 0,
185
"text": "[泠鸢yousa_awsl]",
186
"url": "http://i0.hdslb.com/bfs/emote/7663b729161bd4556c2ec318c07791000743eb56.png",
187
"meta": {
188
"size": 2
189
},
190
"mtime": 1589776042
191
}
192
},
193
"jump_url": {},
194
"max_line": 0
195
},
196
"replies": null,
197
"assist": 0,
198
"folder": {
199
"has_folded": false,
200
"is_folded": false,
201
"rule": "https://www.bilibili.com/blackboard/foldingreply.html"
202
},
203
"up_action": {
204
"like": false,
205
"reply": false
206
},
207
"show_follow": false
208
}
209
}
210
}
211
```
212