mirror of
https://github.com/SocialSisterYi/bilibili-API-collect.git
synced 2025-01-29 21:30:10 +08:00
fix APIdoc 【发布动态】
This commit is contained in:
parent
d37df2ee54
commit
91b1bbf4af
@ -1,27 +1,29 @@
|
||||
# 发布动态
|
||||
|
||||
+ [上传图片](#为图片动态(相簿)上传图片)
|
||||
+ [为图片动态上传图片](#为图片动态上传图片)
|
||||
|
||||
+ [发表纯文本动态](#发表纯文本动态)
|
||||
|
||||
---
|
||||
|
||||
## 为图片动态(相簿)上传图片
|
||||
## 为图片动态上传图片
|
||||
|
||||
> http://api.vc.bilibili.com/api/v1/drawImage/upload
|
||||
> http://api.bilibili.com/x/dynamic/feed/draw/upload_bfs
|
||||
|
||||
*请求方式:POST*
|
||||
|
||||
认证方式:Cookie(SESSDATA)
|
||||
|
||||
~~这是图床?(滑稽保命)~~
|
||||
|
||||
注意:非日常类型像素宽高必须大于420
|
||||
|
||||
**正文参数(multipart/form-data):**
|
||||
**正文参数 (multipart/form-data):**
|
||||
|
||||
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
||||
| -------- | ---- | ------------------ | ------ | ------------------------------------------------------------ |
|
||||
| file_up | file | 需要上传的图片文件 | 必要 | 格式仅支持jpg png gif |
|
||||
| category | str | 图片类型 | 必要 | daily:日常(动态)<br />draw:绘画(画友)<br />cos:摄影(COSPLAY) |
|
||||
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
||||
| -------- | ---- | ------------------------ | ------ | ------------------------------------------------------------ |
|
||||
| file_up | file | 需要上传的图片文件 | 必要 | 格式仅支持jpg png gif |
|
||||
| category | str | 图片类型 | 必要 | daily:日常(动态)<br />draw:绘画(画友)<br />cos:摄影(COSPLAY) |
|
||||
| biz | str | | | |
|
||||
| csrf | str | CSRF Token(位于cookie) | 必要 | |
|
||||
|
||||
**json回复:**
|
||||
|
||||
@ -41,12 +43,12 @@
|
||||
| image_width | num | 已上传图片宽度 | 像素 |
|
||||
| image_height | num | 已上传图片高度 | 像素 |
|
||||
|
||||
示例:
|
||||
**示例:**
|
||||
|
||||
上传了一张图片`test.png`类型为`日常`
|
||||
|
||||
```shell
|
||||
curl 'http://api.vc.bilibili.com/api/v1/drawImage/upload' \
|
||||
curl 'http://api.bilibili.com/x/dynamic/feed/draw/upload_bfs' \
|
||||
-F 'file_up=@test.png' \
|
||||
-F 'category=daily'
|
||||
-b 'SESSDATA=xxx'
|
||||
@ -60,7 +62,7 @@ curl 'http://api.vc.bilibili.com/api/v1/drawImage/upload' \
|
||||
"code":0,
|
||||
"message":"success",
|
||||
"data":{
|
||||
"image_url":"http:\/\/i0.hdslb.com\/bfs\/album\/13f9523efe186a8066b2d72e80283cea2437eb62.png",
|
||||
"image_url":"http:\/\/i0.hdslb.com\/bfs\/album\/13f9523efe186a8066b2d72e80283cea2437eb62.png",
|
||||
"image_width":1225,
|
||||
"image_height":850
|
||||
}
|
||||
@ -76,23 +78,23 @@ curl 'http://api.vc.bilibili.com/api/v1/drawImage/upload' \
|
||||
|
||||
*请求方式:POST*
|
||||
|
||||
认证方式:Cookie(SESSDATA)
|
||||
认证方式:Cookie (SESSDATA)
|
||||
|
||||
**正文参数(multipart/form-data):**
|
||||
|
||||
| 参数名 | 类型 | 内容 |
|
||||
| --- | --- | --- |
|
||||
| dynamic_id | num | 0 |
|
||||
| type | num | 4 |
|
||||
| rid | num | 0 |
|
||||
| content | str | 动态内容 |
|
||||
| up_choose_comment | num | 0 |
|
||||
| up_close_comment | num | 0 |
|
||||
| extension | obj | 位置信息 |
|
||||
| at_uids | str | 动态中at到的用户的uid,逗号分隔 |
|
||||
| ctrl | obj[] | 特殊格式控制(如at别人时的蓝字体和链接) |
|
||||
| csrf_token | str | csrf |
|
||||
| csrf | str | csrf(好像有上边那个就够了 这个不用) |
|
||||
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| dynamic_id | num | 0 | 必要 | |
|
||||
| type | num | 4 | 必要 | |
|
||||
| rid | num | 0 | 必要 | |
|
||||
| content | str | 动态内容 | 必要 | |
|
||||
| up_choose_comment | num | 0 | 非必要 | |
|
||||
| up_close_comment | num | 0 | 非必要 | |
|
||||
| extension | json | 位置信息 | 非必要 | |
|
||||
| at_uids | str | 动态中 at 到的用户的 uid | 非必要 | 使用逗号`,`分隔 |
|
||||
| ctrl | array | 特殊格式控制 (如 at 别人时的蓝字体和链接) | 非必要 | |
|
||||
| csrf_token | str | CSRF Token (位于 cookie) | 非必要 | |
|
||||
| csrf | str | CSRF Token (位于 cookie) | 非必要 | |
|
||||
|
||||
extension参数值:
|
||||
```json
|
||||
@ -111,35 +113,40 @@ ctrl单个对象(注意用的时候是数组出现):
|
||||
|
||||
根对象:
|
||||
|
||||
| 字段 | 类型 | 内容 |
|
||||
| --- | --- | --- |
|
||||
| code | num | 0:成功 |
|
||||
| msg | str | 成功为空文本 |
|
||||
| message | str | 和msg一样 |
|
||||
| data | obj | 详细信息 |
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| --- | --- | --- | --- |
|
||||
| code | num | 返回值 | 0:成功 |
|
||||
| message | str | 错误信息 | 成功为空 |
|
||||
| data | obj | 数据本体 | |
|
||||
|
||||
data对象:
|
||||
`data`对象:
|
||||
|
||||
| 字段 | 类型 | 内容 |
|
||||
| --- | --- | --- |
|
||||
| result | num | 0 |
|
||||
| errmsg | str | 像是服务器日志一样的东西 |
|
||||
| dynamic_id | num | 发布的新动态ID |
|
||||
| create_result | num | 1 |
|
||||
| dynamic_id_str | str | 文本格式的dynamic_id |
|
||||
| \_gt_ | num | 0 |
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| --- | --- | --- | --- |
|
||||
| result | num | 0 | |
|
||||
| errmsg | str | 像是服务器日志一样的东西 | |
|
||||
| dynamic_id | num | 动态 id | |
|
||||
| create_result | num | 1 | |
|
||||
| dynamic_id_str | str | 动态 id | 字符串格式 |
|
||||
| \_gt_ | num | 0 | |
|
||||
|
||||
<details>
|
||||
<summary>查看示例(纯文本)</summary>
|
||||
|
||||
```bash
|
||||
curl 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create' \
|
||||
-X POST \
|
||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0' \
|
||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||
-H 'Referer: https://t.bilibili.com/' \
|
||||
-H 'Cookie: SESSDATA=******; bili_jct=de2731532b4ab96bc8536da948932668;' \
|
||||
--data-raw 'dynamic_id=0&type=4&rid=0&content=Hello%20Bug~&up_choose_comment=0&up_close_comment=0&extension=%7B%22emoji_type%22%3A1%2C%22from%22%3A%7B%22emoji_type%22%3A1%7D%2C%22flag_cfg%22%3A%7B%7D%7D&at_uids=&ctrl=%5B%5D&csrf_token=de2731532b4ab96bc8536da948932668&csrf=de2731532b4ab96bc8536da948932668'
|
||||
curl 'http://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create' \
|
||||
--data-urlencode 'dynamic_id=0' \
|
||||
--data-urlencode 'type=4' \
|
||||
--data-urlencode 'rid=0' \
|
||||
--data-urlencode 'content=Hello Bug~' \
|
||||
--data-urlencode 'up_choose_comment=0' \
|
||||
--data-urlencode 'up_close_comment=0' \
|
||||
--data-urlencode 'extension={"emoji_type":1,"from":{"emoji_type":1},"flag_cfg":{}}' \
|
||||
--data-urlencode 'at_uids=' \
|
||||
--data-urlencode 'ctrl=[]' \
|
||||
--data-urlencode 'csrf_token=de2731532b4ab96bc8536da948932668' \
|
||||
--data-urlencode 'csrf=de2731532b4ab96bc8536da948932668' \
|
||||
-b 'SESSDATA=******'
|
||||
```
|
||||
|
||||
```json
|
||||
@ -184,12 +191,19 @@ ctrl
|
||||
|
||||
命令
|
||||
```bash
|
||||
curl 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create' \
|
||||
-X POST -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0' \
|
||||
-H 'Accept: application/json, text/plain, */*' \
|
||||
-H 'Referer: https://t.bilibili.com/' \
|
||||
-H 'Cookie: SESSDATA=******; bili_jct=de2731532b4ab96bc8536da948932668' \
|
||||
--data-raw 'dynamic_id=0&type=4&rid=0&content=%5B%E7%83%AD%E8%AF%8D%E7%B3%BB%E5%88%97_%E7%A5%9E%E4%BB%99UP%5D%40%E6%9A%AE%E5%85%89%E5%B0%8F%E7%8C%BFwzt%20%40%E7%A4%BE%E4%BC%9A%E6%98%93%E5%A7%90QwQ%20&up_choose_comment=0&up_close_comment=0&extension=%7B%22emoji_type%22%3A1%2C%22from%22%3A%7B%22emoji_type%22%3A1%7D%2C%22flag_cfg%22%3A%7B%7D%7D&at_uids=15858903%2C293793435&ctrl=%5B%7B%22location%22%3A11%2C%22type%22%3A1%2C%22length%22%3A9%2C%22data%22%3A%2215858903%22%7D%2C%7B%22location%22%3A20%2C%22type%22%3A1%2C%22length%22%3A9%2C%22data%22%3A%22293793435%22%7D%5D&csrf_token=de2731532b4ab96bc8536da948932668&csrf=de2731532b4ab96bc8536da948932668'
|
||||
curl 'http://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/create' \
|
||||
--data-urlencode 'dynamic_id': '0' \
|
||||
--data-urlencode 'type': '4' \
|
||||
--data-urlencode 'rid': '0' \
|
||||
--data-urlencode 'content': '[热词系列_神仙UP]@暮光小猿wzt @社会易姐QwQ ' \
|
||||
--data-urlencode 'up_choose_comment': '0' \
|
||||
--data-urlencode 'up_close_comment': '0' \
|
||||
--data-urlencode 'extension': '{"emoji_type":1,"from":{"emoji_type":1},"flag_cfg":{}}' \
|
||||
--data-urlencode 'at_uids': '15858903,293793435' \
|
||||
--data-urlencode 'ctrl': '[{"location":11,"type":1,"length":9,"data":"15858903"},{"location":20,"type":1,"length":9,"data":"293793435"}]' \
|
||||
--data-urlencode 'csrf_token': 'de2731532b4ab96bc8536da948932668' \
|
||||
--data-urlencode 'csrf': 'de2731532b4ab96bc8536da948932668' \
|
||||
-b 'SESSDATA=******'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
Loading…
Reference in New Issue
Block a user