Files
bilibili-API-collect/video/report.md
2020-06-21 13:16:31 +08:00

46 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 视频观看数据上报
**本页所有操作均需登录SESSDATA**
## 上报观看进度暂不支持bvID
> http://api.bilibili.com/x/v2/history/report
*方式POST*
**正文参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| -------- | ---- | ------------------- | ------ | --------------------- |
| aid | num | 视频avID | 必要 | |
| cid | num | 视频CID | 必要 | 用于识别分P |
| progress | num | 观看进度 | 非必要 | 单位为秒<br />默认为0 |
| csrf | str | cookies中的bili_jct | 必要 | |
**json回复**
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0成功 <br />-101账号未登录<br />-111csrf校验失败<br />-400请求错误 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 1 | 作用尚不明确 |
**示例:**
记录视频`av13662970``CID=126654047`)的观看记录位于`1248`
curl -b "SESSDATA=xxx" -d "aid=13662970&cid=126654047&progress=1248&csrf=xxx" "http://api.bilibili.com/x/v2/history/report"
```json
{
"code": 0,
"message": "0",
"ttl": 1
}
```