添加修改空间布局和隐私设置的两个api,并修改格式

This commit is contained in:
社会易姐QwQ
2020-04-23 18:26:00 +08:00
parent 8812c09bcd
commit 3a14612eca
7 changed files with 157 additions and 11 deletions

View File

@@ -367,7 +367,7 @@ http://api.bilibili.com/x/relation/followings?vmid=293793435&ps=2&pn=1
关注`UID=14082`的用户
curl -b SESSDATA=xxx -d "fid=14082&act=1&re_src=11&csrf=xxx" http://api.bilibili.com/x/relation/modify
curl -b SESSDATA=xxx -d "fid=14082&act=1&re_src=11&csrf=xxx" "http://api.bilibili.com/x/relation/modify"
```json
{
@@ -830,7 +830,7 @@ http://api.bilibili.com/x/relation/tag/user?fid=319214221
创建了名为`vUP`的分组得到ID为`216677`
curl -b SESSDATA=xxx -d "tag=vUP&csrf=xxx" http://api.bilibili.com/x/relation/tag/create
curl -b SESSDATA=xxx -d "tag=vUP&csrf=xxx" "http://api.bilibili.com/x/relation/tag/create"
```json
{
@@ -875,7 +875,7 @@ curl -b SESSDATA=xxx -d "tag=vUP&csrf=xxx" http://api.bilibili.com/x/relation/ta
把ID为`194112`的分组更名为`膜法师`
curl -b SESSDATA=xxx -d "tagid=194112&name=%e8%86%9c%e6%b3%95%e5%b8%88&csrf=xxx" http://api.bilibili.com/x/relation/tag/update
curl -b SESSDATA=xxx -d "tagid=194112&name=%e8%86%9c%e6%b3%95%e5%b8%88&csrf=xxx" "http://api.bilibili.com/x/relation/tag/update"
```json
{
@@ -918,7 +918,7 @@ curl -b SESSDATA=xxx -d "tagid=194112&name=%e8%86%9c%e6%b3%95%e5%b8%88&csrf=xxx"
删除分组ID为`216699`的分组
curl -b SESSDATA=xxx -d "tagid=216699&csrf=xxx" http://api.bilibili.com/x/relation/tag/del
curl -b SESSDATA=xxx -d "tagid=216699&csrf=xxx" "http://api.bilibili.com/x/relation/tag/del"
```json
{
@@ -962,7 +962,7 @@ curl -b SESSDATA=xxx -d "tagid=216699&csrf=xxx" http://api.bilibili.com/x/relati
把关注用户`UID=205631797`同时添加分组关系到ID为`-10``207542`的分组中
curl -b SESSDATA=xxx -d "fids=205631797&tagids=-10%2C207542&csrf=xxx" http://api.bilibili.com/x/relation/tags/addUsers
curl -b SESSDATA=xxx -d "fids=205631797&tagids=-10%2C207542&csrf=xxx" "http://api.bilibili.com/x/relation/tags/addUsers"
```json
{
@@ -1004,7 +1004,7 @@ curl -b SESSDATA=xxx -d "fids=205631797&tagids=-10%2C207542&csrf=xxx" http://api
把关注用户`UID=4856007``UID=326499679`同时复制到ID为`231305`的分组中
curl -b SESSDATA=xxx -d "fids=4856007%2C326499679&tagids=231305&csrf=xxx" http://api.bilibili.com/x/relation/tags/copyUsers
curl -b SESSDATA=xxx -d "fids=4856007%2C326499679&tagids=231305&csrf=xxx" "http://api.bilibili.com/x/relation/tags/copyUsers"
```json
{
@@ -1049,7 +1049,7 @@ curl -b SESSDATA=xxx -d "fids=4856007%2C326499679&tagids=231305&csrf=xxx" http:/
69``UID=327086920`同时从ID为`207542`的分组移动到ID为`231305`的分组中
curl -b SESSDATA=xxx -d "beforeTagids=207542&afterTagids=231305&fids=3211734
69%2C327086920&csrf=xxx" http://api.bilibili.com/x/relation/tags/moveUsers
69%2C327086920&csrf=xxx" "http://api.bilibili.com/x/relation/tags/moveUsers"
```json
{

View File

@@ -1650,6 +1650,123 @@ curl -b "sessdata=xxx" -d "csrf=xxx&notice=%E9%B8%BD%E5%AD%90" "http://api.bilib
### 修改空间隐私权限
> http://space.bilibili.com/ajax/settings/setPrivacy
*方式POST*
需要登录(SESSDATA)
需要验证`DedeUserID``DedeUserID__ckMd5`存在且不为0
需要验证`referer``http://www.bilibili.com``https://www.bilibili.com`域名下
**参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ----------- | ---- | ------------------- | ------ | ------------------------------ |
| fav_video | data | 收藏视频 | 非必要 | 0隐藏<br />1公开<br />下同 |
| bangumi | data | 追番及追剧 | 非必要 | |
| tags | data | 关注的TAG | 非必要 | |
| coins_video | data | 投币的视频 | 非必要 | |
| user_info | data | 个人信息 | 非必要 | |
| played_game | data | 玩过的游戏 | 非必要 | |
| csrf | data | cookies中的bili_jct | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------ | ---- | -------- | ----------------------------------- |
| ststus | bool | 操作结果 | true操作成功<br />false操作失败 |
| data | str | 错误信息 | 正确时无此项 |
**示例:**
设置`关注的TAG`为隐藏
curl --referer "http://www.bilibili.com" -b "SESSDATA=xxx;DedeUserID=1;DedeUserID__ckMd5=1;" -d "csrf=xxx&tags=0" "http://space.bilibili.com/ajax/settings/setPrivacy"
```json
{
"status": true
}
```
### 调整空间板块布局
> http://space.bilibili.com/ajax/settings/setIndexOrder
*方式POST*
需要登录(SESSDATA)
需要验证`DedeUserID``DedeUserID__ckMd5`存在且不为0
需要验证`referer``http://www.bilibili.com``https://www.bilibili.com`域名下
**参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ----------- | ---- | ------------------- | ------ | ------------------------------------------------------------ |
| index_order | data | 布局列表 | 必要 | 每个值之间用","%2C分隔<br />先左侧布局再右侧布局<br />值的意义见下表 |
| csrf | data | cookies中的bili_jct | 必要 | |
布局参数`index_order`
| 值 | 含义 |
| ---- | ---------------------- |
| 1 | (左侧)我的稿件 |
| 2 | (左侧)我的收藏夹 |
| 3 | (左侧)订阅番剧 |
| 4 | (左侧)订阅标签 |
| 5 | (左侧)最近投币的视频 |
| 6 | **作用尚不明确** |
| 7 | (左侧)我的频道 |
| 8 | (左侧)我的专栏 |
| 9 | (左侧)我的相簿 |
| 21 | (右侧)公告 |
| 22 | (右侧)直播间 |
| 23 | (右侧)个人资料 |
| 24 | (右侧)官方活动 |
| 25 | (右侧)最近玩的游戏 |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------ | ---- | -------- | ----------------------------------- |
| ststus | bool | 操作结果 | true操作成功<br />false操作失败 |
| data | str | 错误信息 | 正确时无此项 |
**示例:**
调整空间布局为:
>我的稿件 直播间
>我的专栏 个人资料
>订阅番剧 公告
>我的收藏夹 官方活动
>我的相簿 最近玩的游戏
>最近投币的视频
>订阅标签
>我的频道
curl --referer "http://www.bilibili.com" -b "SESSDATA=xxx;DedeUserID=1;DedeUserID__ckMd5=1;" -d "csrf=xxx&index_order=1%2C8%2C3%2C2%2C9%2C5%2C4%2C7%2C22%2C23%2C21%2C24%2C25%2C6" "http://space.bilibili.com/ajax/settings/setIndexOrder"
```json
{
"status": true
}
```
### 修改个人TAG
> http://api.bilibili.com/x/space/acc/tags/set