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

@@ -72,7 +72,7 @@ curl 'https://api.bilibili.com/x/v2/history/report' \
## 上报视频播放心跳web端
> https://api.bilibili.com/x/click-interface/web/heartbeat
> https://api.bilibili.com/x/click-interface/web/heartbeat
*请求方式POST*
@@ -80,8 +80,6 @@ curl 'https://api.bilibili.com/x/v2/history/report' \
默认间隔15秒一次, 亦可记录播放历史
尽管以下除正文 `aid` 以外的参数均为非必要, 但缺少可能会导致播放不被记录, 同一 IP/登陆用户 每五分钟最多记录一次播放
该接口较为复杂, 且参数计算方法均为推测, 实际过程不明, 可能含有错误, 若要正式使用可以把已播放的持续时间全都设为相同值
**URL参数:**
@@ -125,11 +123,11 @@ curl 'https://api.bilibili.com/x/v2/history/report' \
| dt | num | 2 | 非必要 | |
| outer | num | 0 | 非必要 | |
| spmid | str | 333.788.0.0 | 非必要 | 作用尚不明确 |
| from_spmid | str | 播放来源? | 非必要 | 也可为空, 如: 444.41.list.card_archive.click |
| session | str | 会话信息? | 非必要 | 每次刷新均不同, 生成原理尚不明确 |
| from_spmid | str | 播放来源? | 非必要 | 也可为空, 如: `444.41.list.card_archive.click` `333.999.0.0` |
| session | str | 会话信息? | 非必要 | 一串无分隔小写 UUID |
| extra | obj | 额外信息, 如播放器版本 | 非必要 | 如: `{"player_version":"4.8.36"}` |
| play_type | num | 播放动作 | 非必要 | 0播放中<br />1开始播放<br />2暂停<br />3继续播放<br />4: 结束播放 |
| csrf | str | CSRF Token即 Cookie 中 bili_jct) | 非必要 | |
| csrf | str | CSRF Token (即 Cookie 中 bili_jct) | 非必要 | |
**json回复**
@@ -172,3 +170,76 @@ curl 'https://api.bilibili.com/x/click-interface/web/heartbeat' \
```
</details>
## 开始观看视频 (web端)
> https://api.bilibili.com/x/click-interface/click/web/h5
*请求方式: POST*
认证方式: Cookie (SESSDATA)
该接口亦被用于计算播放量, 播放量更新不是实时的
**URL参数:**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | -------- | ------ | ---- |
| w_aid | num | 稿件 aid | 不必要 | |
| w_part | num | 视频分 P 编号 | 不必要 | |
| w_ftime | num | 点击时间戳? | 不必要 | UNIX 秒级时间戳 |
| w_stime | num | 开始播放时间戳? | 不必要 | UNIX 秒级时间戳 |
| w_type | num | 视频类型 | 不必要 | 见[上报视频播放心跳web端](#上报视频播放心跳web端) |
| web_location | num | 网页位置? | 不必要 | 1315873 |
| w_rid | num | WBI 签名 | 不必要 | 参见[WBI 签名](docs/misc/sign/wbi.md) |
| wts | num | UNIX 秒级时间戳 | 不必要 | 参见[WBI 签名](docs/misc/sign/wbi.md) |
**正文参数 (application/x-www-form-urlencoded):**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | -------- | ------ | ---- |
| mid | num | 当前用户 mid | 不必要 | |
| aid | num | 稿件 aid | 必要 | |
| cid | num | 视频 cid | 不必要 | |
| part | num | 视频分 P 编号 | 不必要 | |
| lv | num | 当前用户等级 | 不必要 | |
| ftime | num | 同 URL 参数中带有 `w_` 前缀的同名参数 | 不必要 | |
| stime | num | 同 URL 参数中带有 `w_` 前缀的同名参数 | 不必要 | |
| type | num | 视频类型 | 不必要 | 见[上报视频播放心跳web端](#上报视频播放心跳web端) |
| sub_type | num | 视频子类型 | 不必要 | 见[上报视频播放心跳web端](#上报视频播放心跳web端) |
| referer_url | str | 与请求头 Referer 字段相同 | 不必要 | |
| outer | num | 0 | 不必要 | |
| spmid | str | 333.788.0.0 | 不必要 | 作用尚不明确 |
| from_spmid | str | 播放来源? | 不必要 | 见[上报视频播放心跳web端](#上报视频播放心跳web端) |
| session | str | 会话信息? | 不必要 | 一串无分隔小写 UUID |
| csrf | str | CSRF Token (即 Cookie 中 bili_jct) | 不必要 | |
**JSON回复:**
根对象:
|字段|类型|内容|备注|
|-|-|-|-|
|code|num|返回值|0成功<br />-400请求错误|
|message|str|错误信息|默认为 `0`|
|ttl|num|1||
**示例:**
```shell
curl 'https://api.bilibili.com/x/click-interface/click/web/h5' \
--data-urlencode 'aid=2' \
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"message": "0",
"ttl": 1
}
```
</details>