feat: 各种接口补充与错误修正 (#1066)

* fix(video/collection.md): unclosed xml tags

* feat(video/report.md): uuid not really random

* feat: b23.tv short link

* feat: login/moral/exp log

* feat: v_voucher

* feat: upload video cover & post

* feat(creativecenter/upload.md): upload octet-stream

* feat(creativecenter/upload.md): update some notes

* feat(clientinfo/ip.md): another from live

* feat: live web heartbeat

* feat: update popular series & precious

* fix(creativecenter/upload.md): mistakes in example

* feat: merge duplicate fav info

* feat(README.md): missing link to webmask

* feat(search/hot.md): word_type

* feat(login/login_action): recovery old api

* feat(video/collection.md):  series operation

* feat: video season operation

* feat: add & mod some links

* feat(search/suggest.md): up to date

* feat: web home header image

* feat(misc/sign/bili_ticket.md): demo for nodejs

* feat(creativecenter/upload.md): x-upos-auth validity period

* feat: add referer & buvid3 to request header

* feat: customer service message heartbeat & upload

* feat(customerservice/msg.md): upload code 1200201

* feat(video/report.md): click/web/h5

* feat(video/report.md): view count desc

* feat: laser2

* feat: wbi_key in bili_ticket

* fix: typo & unclosed XML tags

* feat(misc/sign/v_voucher): cookie x-bili-gaia-vtoken

* feat(search/hot.md): square

* feat(video/status_number.md): fold archive_stat/stat

* feat(fav/info.md): resource/infos invalid type 21

* feat: /x/activity/subject/info

* feat: lottery

* feat(docs/misc/b23.tv): remove some unnecessary fields

* feat(creativecenter/upload.md): types/predict

* fix(video/collection.md): invalid end tag

* feat: app version upgrade

* feat(creativecenter/upload.md): tag/recommend #528

* feat(user/status_number.md): navnum

* feat: /x/activity/page/list

* feat(comment/list.md): desc about pagination_str

* feat(comment/list.md): update example

* feat(dynamic/all.md): #1082

* fix(comment/list.md): -352 not -412

* feat: #700

* feat(video/video_stream.md): #606 & cv949156

* feat(message/private_msg.md): single_unread freq

* feat: getUserWallet

* fix: broken form

* feat(Layout.vue): copyright to 2024

* feat: /x/topic/pub/rcmd/search

* feat: #425

* feat(misc/time_stamp.md): rtc/getTimestamp

* fix(misc/time_stamp.md): missing end tag

* feat: #745

* feat(dynamic/all.md): update feed/all

* feat(danmaku/action.md): #220

* feat(live/info.md): gethistory from cv8186413

* fix(danmaku/action.md): missing end tag
This commit is contained in:
Session小胡
2024-08-21 19:02:39 +08:00
committed by GitHub
parent f7599fb693
commit 60a0c5d1a2
46 changed files with 18489 additions and 8207 deletions

View File

@@ -65,6 +65,123 @@ curl 'https://api.bilibili.com/x/web-interface/search/default'
</details>
## 获取热搜列表
> https://api.bilibili.com/x/web-interface/search/square
*请求方式: GET*
**URL参数:**
|参数名|类型|内容|必要性|备注|
|-|-|-|-|-|
|limit|num|结果限制|必要|范围 [1, 50]|
|platform|str|平台标识|不必要|web: web 端|
**JSON回复:**
根对象:
|字段|类型|内容|备注|
|-|-|-|-|
|code|num|返回值|0: 成功<br />-400: 请求错误|
|message|str|错误信息|默认为空|
|ttl|num|1||
|data|obj|数据本体||
`data`对象:
|字段|类型|内容|备注|
|-|-|-|-|
|trending|obj|热搜榜单|套了个娃|
`data`中的`trending`对象:
|字段|类型|内容|备注|
|-|-|-|-|
|title|str|标题||
|trackid|str|跟踪 ID?||
|list|array|热搜列表||
|top_list|array|空||
`trending`中的`list`数组:
|项|类型|内容|备注|
|-|-|-|-|
|0|obj|热搜 1||
|1|obj|热搜 2||
|……|obj|……||
|n|obj|热搜 (n+1)||
`list`数组中的对象:
|字段|类型|内容|备注|
|-|-|-|-|
|keyword|str|关键词||
|show_name|str|显示文字||
|icon|str|图标 URL||
|uri|str|空||
|goto|str|空||
**示例:**
获取热搜列表, 数量限制 4
```shell
curl -G --url 'https://api.bilibili.com/x/web-interface/search/square' \
--url-query 'limit=4'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"trending": {
"title": "bilibili热搜",
"trackid": "8079760748892487175",
"list": [
{
"keyword": "马克龙祝贺中国世界前两名",
"show_name": "马克龙祝贺中国世界前两名",
"icon": "http://i0.hdslb.com/bfs/activity-plat/static/20221213/eaf2dd702d7cc14d8d9511190245d057/lrx9rnKo24.png",
"uri": "",
"goto": ""
},
{
"keyword": "小孩电竞世界杯夺冠",
"show_name": "小孩电竞世界杯夺冠",
"icon": "http://i0.hdslb.com/bfs/activity-plat/static/20221213/eaf2dd702d7cc14d8d9511190245d057/lrx9rnKo24.png",
"uri": "",
"goto": ""
},
{
"keyword": "孙颖莎说我全勤下班了",
"show_name": "孙颖莎说我全勤下班了",
"icon": "http://i0.hdslb.com/bfs/activity-plat/static/20221118/eaf2dd702d7cc14d8d9511190245d057/UF7B1wVKT2.png",
"uri": "",
"goto": ""
},
{
"keyword": "7月广东新冠新增一万余例",
"show_name": "7月广东新冠新增一万余例",
"icon": "http://i0.hdslb.com/bfs/activity-plat/static/20221213/eaf2dd702d7cc14d8d9511190245d057/lrx9rnKo24.png",
"uri": "",
"goto": ""
}
],
"top_list": []
}
}
}
```
</details>
## 获取热搜列表web端
> https://s.search.bilibili.com/main/hotword
@@ -109,7 +226,7 @@ curl 'https://api.bilibili.com/x/web-interface/search/default'
| res | array| null | |
| show_name | str | 完整关键词| |
| pos | num | 名次 | 1-10 |
| word_type | num | 条目属性 | 均返回8 |
| word_type | num | 条目属性 | 4: 新<br />5: 热<br />6: [雾,咒,小丑(愚人节)] 具体看icon<b r/>7: 直播中<br />8: 默认(无标签)<br />9: 梗<br />11: 话题<br />12: 独家 |
| id | num | 名次 | 1-10 |
| goto_value | str | 空 | |
| live_id | array| null | |
@@ -353,7 +470,7 @@ curl 'https://s.search.bilibili.com/main/hotword'
*请求方式GET*
榜单每隔固定时间统计一次请求后返回搜索前20的关键词
榜单每隔固定时间统计一次
带有转义
@@ -361,7 +478,7 @@ curl 'https://s.search.bilibili.com/main/hotword'
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------- | ---- | ---------------- | ------ | ---- |
| limit | num | 热搜数量 | 非必要 | 1~100 |
| limit | num | 热搜数量 | 非必要 | 留空为20, 最大为100 |
**json回复**
@@ -395,7 +512,7 @@ curl 'https://s.search.bilibili.com/main/hotword'
| position | num | 名次 | 1-20/limit |
| keyword | str | 关键词 | |
| show_name | str | 完整关键词| |
| word_type | num | 条目属性 | 4<br />5<br />6<br />8默认 |
| word_type | num | 条目属性 | 同 web 端 |
| icon | str | 图标url | |
| hot_id | num | 热词id | 大概是吧? |

View File

@@ -579,8 +579,6 @@ curl -G 'https://api.bilibili.com/x/web-interface/search/all/v2' \
</details>
## 分类搜索web端
> https://api.bilibili.com/x/web-interface/wbi/search/type
@@ -589,9 +587,7 @@ curl -G 'https://api.bilibili.com/x/web-interface/search/all/v2' \
*请求方式GET*
认证方式:CookieSESSDATA
鉴权方式:[Wbi 签名](../misc/sign/wbi.md)
鉴权方式:[Wbi 签名](../misc/sign/wbi.md), Cookie 中含有 [`buvid3`](../misc/buvid3_4.md) 字段, Referer 在 `.bilibili.com` 下, User-Agent 不含敏感子串
根据关键词进行搜索返回结果每页20项

View File

@@ -12,11 +12,26 @@
**url参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| --------- | ---- | ---------------------- | ------ | ------------------------ |
| term | str | 需要获得建议的输入内容 | 必要 | |
| main_ver | str | v1 | 非必要 | 固定为`v1` |
| highlight | str | 任意 | 非必要 | 有此项开启关键词高亮标签 |
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| --------------- | ---- | ---------------------- | ------ | ------------------------ |
| term | str | 需要获得建议的输入内容 | 必要 | |
| main_ver | str | v1 | 非必要 | 默认为 `v1` |
| highlight | str | 任意, 无明显作用 | 非必要 | 默认为空 |
| func | str | 函数? | 非必要 | 默认为 `suggest` |
| suggest_type | str | 建议类型? | 非必要 | 默认为 `accurate` |
| sub_type | str | 子类型? | 非必要 | 默认为 `tag` |
| userid | num | 本用户 mid | 非必要 | 可能用于个性化推荐 |
| bangumi_acc_num | num | 番剧累积数? | 非必要 | 默认为 `1` |
| special_acc_num | num | 特殊累积数? | 非必要 | 默认为 `1` |
| topic_acc_num | num | 话题累积数? | 非必要 | 默认为 `1` |
| upuser_acc_num | num | UP主累积数? | 非必要 | 默认为 `1` |
| tag_num | num | Tag 数? | 非必要 | 默认为 `10` |
| special_num | num | 特殊推荐数? | 非必要 | 默认为 `10` |
| bangumi_num | num | 番剧推荐数? | 非必要 | 默认为 `10` |
| upuser_num | num | UP主推荐数? | 非必要 | 默认为 `3` |
| rnd | num | 一个随机浮点数 | 非必要 | 由 `Math.random()` 生成? |
| buvid | str | 同 Cookie 中 buvid3 | 非必要 | |
| spmid | str | 333.1007 | 非必要 | |
**json回复**
@@ -24,27 +39,11 @@
| 字段 | 类型 | 内容 | 备注 |
| ----------- | ---- | ------------ | ------------ |
| exp_str | str | 实验字符串? | 作用尚不明确 |
| code | num | 返回值 | 0成功 |
| cost | obj | 详细搜索用时 | 大概是吧? |
| result | obj | 搜索建议结果 | |
| page caches | obj | | 作用尚不明确 |
| sengine | obj | | 作用尚不明确 |
| stoken | str | | 作用尚不明确 |
`cost`对象:
| 字段 | 类型 | 内容 | 备注 |
| ----- | ---- | -------- | ---- |
| about | obj | 套了个娃 | |
`cost`中的`about`对象:
| 字段 | 类型 | 内容 | 备注 |
| ------------ | ---- | ---- | ---- |
| params_check | str | | |
| total | str | | |
| main_handler | str | | |
`result`对象:
| 字段 | 类型 | 内容 | 备注 |
@@ -61,120 +60,115 @@
`tag`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ----- | ---- | ---------- | ------------------------------------------------------------ |
| value | str | 关键词内容 | |
| ref | num | 0 | 作用尚不明确 |
| name | str | 显示内容 | 在无高亮显示时与`value`相同<br />有高亮显示时带有`<em class="suggest_high_light">`的xml标签 |
| spid | num | | 作用尚不明确 |
`page caches`对象:
| 字段 | 类型 | 内容 | 备注 |
| ---------- | ---- | ---- | ------------ |
| save cache | str | no | 作用尚不明确 |
`sengine`对象:
| 字段 | 类型 | 内容 | 备注 |
| ----- | ---- | ---- | ------------ |
| usage | num | 0 | 作用尚不明确 |
| 字段 | 类型 | 内容 | 备注 |
| ----- | ---- | ---------- | -------------------------------------------------- |
| value | str | 关键词内容 | |
| ref | num | 0 | 作用尚不明确 |
| name | str | 显示内容 | 带有 `<em class="suggest_high_light">` 的 XML 标签 |
| spid | num | 5 | 作用尚不明确 |
| type | str | 空 | |
**示例:**
获取关于`lei`的搜索建议,关键词带有高亮
获取关于 `洛天依` 的搜索建议
```shell
curl -G 'https://s.search.bilibili.com/main/suggest' \
--data-urlencode 'term=lei' \
--data-urlencode 'main_ver=v1' \
--data-urlencode 'highlight='
--data-urlencode 'term=洛天依'
```
<details>
<summary>查看响应示例</summary>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"cost": {
"about": {
"params_check": "0.000103",
"total": "0.011644",
"main_handler": "0.011472"
}
},
"result": {
"tag": [
{
"value": "雷军",
"ref": 0,
"name": "雷军",
"spid": 1
},
{
"value": "雷之律者",
"ref": 0,
"name": "雷之律者",
"spid": 5
},
{
"value": "LEI神",
"ref": 0,
"name": "<em class=\"suggest_high_light\">LEI</em>神",
"spid": 5
},
{
"value": "LEIGH ELLEXSON",
"ref": 0,
"name": "<em class=\"suggest_high_light\">LEI</em>GH ELLEXSON",
"spid": 5
},
{
"value": "LEICA Q2",
"ref": 0,
"name": "<em class=\"suggest_high_light\">LEI</em>CA Q2",
"spid": 5
},
{
"value": "LEIGHANNE",
"ref": 0,
"name": "<em class=\"suggest_high_light\">LEI</em>GHANNE",
"spid": 0
},
{
"value": "雷达探测姬",
"ref": 0,
"name": "雷达探测姬",
"spid": 5
},
{
"value": "雷律",
"ref": 0,
"name": "雷律",
"spid": 5
},
{
"value": "雷霆嘎巴",
"ref": 0,
"name": "雷霆嘎巴",
"spid": 5
},
{
"value": "雷霆沙赞",
"ref": 0,
"name": "雷霆沙赞",
"spid": 5
}
]
},
"page caches": {
"save cache": "no"
},
"sengine": {
"usage": 0
},
"stoken": "12344377692164099019"
"exp_str": "106301_106700",
"code": 0,
"result": {
"tag": [
{
"value": "洛天依",
"term": "洛天依",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>",
"spid": 5,
"type": ""
},
{
"value": "洛天依十二周年",
"term": "洛天依十二周年",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>十二周年",
"spid": 5,
"type": ""
},
{
"value": "洛天依演唱会",
"term": "洛天依演唱会",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>演唱会",
"spid": 5,
"type": ""
},
{
"value": "洛天依手办",
"term": "洛天依手办",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>手办",
"spid": 5,
"type": ""
},
{
"value": "洛天依歌曲",
"term": "洛天依歌曲",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>歌曲",
"spid": 5,
"type": ""
},
{
"value": "洛天依童话镇",
"term": "洛天依童话镇",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>童话镇",
"spid": 5,
"type": ""
},
{
"value": "洛天依东京不太热",
"term": "洛天依东京不太热",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>东京不太热",
"spid": 5,
"type": ""
},
{
"value": "洛天依霜雪千年",
"term": "洛天依霜雪千年",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>霜雪千年",
"spid": 5,
"type": ""
},
{
"value": "洛天依生日会",
"term": "洛天依生日会",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>生日会",
"spid": 5,
"type": ""
},
{
"value": "洛天依生日",
"term": "洛天依生日",
"ref": 0,
"name": "<em class=\"suggest_high_light\">洛天依</em>生日",
"spid": 5,
"type": ""
}
]
},
"stoken": "4020133863501304726"
}
```