Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调整部分接口描述与错误修复 #1088

Merged
merged 33 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9f012f1
fix(search/search_request.md): cookie buvid3
SessionHu Aug 27, 2024
6e14de3
feat(login/login_action/password.md): more sms desc
SessionHu Aug 27, 2024
1f8b2ad
fix: typo
SessionHu Aug 27, 2024
25d485d
feat(live/info.md): add ps for getRoomBaseInfo
SessionHu Aug 27, 2024
f8d2c95
fix(danmaku/action.md): broken form
SessionHu Aug 27, 2024
8c07c7c
chore: Browserslist: caniuse-lite is outdated
SessionHu Aug 27, 2024
e8942d8
feat(comment/list.md): reply/wbi/main param next
SessionHu Aug 27, 2024
3a266e2
feat(misc/buvid3_4.md): get buvid3 only
SessionHu Aug 27, 2024
b11e07a
fix: broken links & wrong code type
SessionHu Aug 28, 2024
3d829da
feat: close all img & br tags
SessionHu Aug 28, 2024
d90977d
feat(login/cookie_refresh.md): missing demo links
SessionHu Aug 29, 2024
bd4709b
feat(dynamic/detail.md): /lottery_svr/v1/lottery_svr/lottery_notice
SessionHu Aug 29, 2024
b72a081
fix(video/action.md): share cookie buvid3
SessionHu Aug 29, 2024
9e285f0
feat: deprecated stat & attribute
SessionHu Aug 29, 2024
5731cee
feat(dynamic/detail.md): reaction
SessionHu Aug 30, 2024
119cbcc
feat(misc/sign/v_voucher.md): header
SessionHu Aug 30, 2024
cc6169f
feat(dynamic/detail.md): update detail params & example
SessionHu Aug 30, 2024
f588fbd
feat(APP_widget/ver.md): /x/v2/version
SessionHu Aug 30, 2024
c17fb14
feat(video/info.md): update view
SessionHu Aug 30, 2024
7e705bb
feat(docs/user.md): remove channel
SessionHu Aug 30, 2024
ce660c8
feat(search/search_request.md): search/type -1200
SessionHu Aug 30, 2024
6656238
feat(user/space.md): audio
SessionHu Aug 30, 2024
d83770d
feat(video/player.md): /x/player/wbi/v2
SessionHu Aug 30, 2024
a8d4430
feat(audio/musicstream_url.md): update web/url
SessionHu Aug 30, 2024
d50be15
feat(comment/readme.md): state
SessionHu Aug 30, 2024
4e6602b
fix(user/medal.md): wrong guard_level desc
SessionHu Aug 31, 2024
b45cb5c
feat(live/message_stream.md): DANMU_MSG
SessionHu Aug 31, 2024
6f63ef4
fix(user/medals): wrong guard_level & guard_icon desc
SessionHu Aug 31, 2024
87199ba
feat(live/message_stream.md): format & add more 'cmd'
SessionHu Aug 31, 2024
be2e52b
feat(live/message_stream.md): add more 'cmd'
SessionHu Aug 31, 2024
5af6971
feat(live/message_stream.md): add tips for non-login users
SessionHu Aug 31, 2024
feb0087
feat(video/player.md): need_login_subtitle
SessionHu Aug 31, 2024
7bb222e
Merge branch 'master' into master
SocialSisterYi Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="./assets/img/logo.png" width="250" height="200">
<img src="./assets/img/logo.png" width="250" height="200" />
</p>
<h1 align="center">哔哩哔哩-API收集整理</h1>
<p align="center" class="shields">
Expand All @@ -13,7 +13,7 @@
<img src="https://img.shields.io/github/forks/SocialSisterYi/bilibili-API-collect.svg" alt="GitHub forks"/>
</a>
<a href="https://github.com/SocialSisterYi/bilibili-API-collect/actions">
<img src="https://img.shields.io/github/actions/workflow/status/SocialSisterYi/bilibili-API-collect/vuepress-deploy.yml">
<img src="https://img.shields.io/github/actions/workflow/status/SocialSisterYi/bilibili-API-collect/vuepress-deploy.yml" />
</a>
<a href="https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/LICENSE" style="text-decoration:none" >
<img src="https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg" alt="GitHub license"/>
Expand Down Expand Up @@ -111,7 +111,7 @@ B站 API 采用 C/S 结构,大多数接口为 REST API 和 gRPC,少部分接
- [ ] [视频](docs/video)
- [x] [视频分区一览 (分区代码)](docs/video/video_zone.md)
- [x] [基本信息](docs/video/info.md)
- [x] [状态数](docs/video/status_number.md)
- [x] [状态数](docs/video/status_number.md) (已失效)
- [x] [快照](docs/video/snapshot.md)
- [x] [点赞 & 投币 & 收藏 & 分享](docs/video/action.md)
- [ ] [TAG](docs/video/tags.md)
Expand Down Expand Up @@ -312,7 +312,7 @@ protobuf 序列格式:[传送门](https://www.jianshu.com/p/a24c88c0526a )

## 💦交流

<img src="https://avatars.githubusercontent.com/u/45892418" width="100" height="100">
<img src="https://avatars.githubusercontent.com/u/45892418" width="100" height="100" />

⚠注意:开源社群欢迎交流探讨,**拒绝**咨询、**不支持**合作,**黑产号**一经发现立即拉黑并举报相关 SRC

Expand All @@ -327,7 +327,7 @@ protobuf 序列格式:[传送门](https://www.jianshu.com/p/a24c88c0526a )

WeChat & Alipay:

<img src="./assets/img/sponsorQR.jpg" width="300" height="300">
<img src="./assets/img/sponsorQR.jpg" width="300" height="300" />

OR Aifadian:[https://afdian.net/@ShakaiAneE](https://afdian.net/@ShakaiAneE)

Expand Down
75 changes: 74 additions & 1 deletion docs/APP_widget/ver.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,78 @@
# 获取最新 APP 版本

## 获取版本信息

> https://app.bilibili.com/x/v2/version

*请求方法: GET*

<!--{
"from": {
"url": "https://app.bilibili.com/"
}
}-->

**URL参数:**

| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| --- | --- | --- | --- | --- |
| mobi_app | str | 目标客户端类型 | 不必要 | 留空为最新有更新的平台<br />android: Android 版<br />iphone: iPhone 版<br />ipad: iPad HD 版<br />win: UWP 版<br />android_tv_yst: TV 版<br />android_car: 车机版<br />pc_client: PC 客户端 |

**JSON回复:**

| 字段 | 类型 | 内容 | 备注 |
| --- | --- | --- | --- |
| code | int | 返回值 | 0: 成功 |
| message | str | 错误信息 | 默认为 `0` |
| ttl | int | 1 | |
| data | array | 版本信息列表 | |

`data` 数组中的对象:

| 字段 | 类型 | 内容 | 备注 |
| --- | --- | --- | --- |
| plat | int | 平台 | 0: Android<br />1: iPhone<br />2: iPad HD<br />3: UWP<br />12: TV 版<br />35: 车机版<br />40: PC 客户端 |
| desc | str | 版本描述 | |
| version | str | 版本号 | |
| build | int | 内部版本号 | |

**示例:**

```shell
curl -G 'https://app.bilibili.com/x/v2/version' \
--url-query'mobi_app=android'
```

<details>
<summary>查看响应示例:</summary>

```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": [
{
"plat": 0,
"desc": "-修复了一些bug,切了个大西瓜~",
"version": "8.9.0",
"build": 8090300,
"ptime": 1723612377
},
// ...
{
"plat": 0,
"desc": "[修正]横屏状态下,视频列表加载失败的问题\n[修正]超过48kHz采样率的音频无法播放的问题\n[修正]部分系统黑屏的问题\nPS:帮下面的同学祈祷早日上架",
"version": "2.0.4",
"build": 0,
"ptime": 1382630400
}
]
}
```

</details>

## 版本升级

> https://app.bilibili.com/x/v2/version/fawkes/upgrade
Expand Down Expand Up @@ -50,7 +123,7 @@

**示例:**

```curl
```shell
curl -G 'https://app.bilibili.com/x/v2/version/fawkes/upgrade' \
--url-query 'build=1145141' \
--url-query 'channel=apt' \
Expand Down
2 changes: 1 addition & 1 deletion docs/activity/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
**URL参数:**

| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| - | - | - | - | - | - | - |
| - | - | - | - | - |
| sid | num | 活动 id | 必要 | |
| bvid | str | 来源视频 bvid | 非必要 | |

Expand Down
71 changes: 36 additions & 35 deletions docs/audio/musicstream_url.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | -------- | ------ | ---- |
| sid | num | 音频auid | 必要 | |
| quality | num | 2 | 不必要 | |
| privilege | num | 2 | 不必要 | |

**json回复:**

根对象:

| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ----------------------------------------------------------- |
| code | num | 返回值 | 0:成功<br />7201006:未找到或已下架<br />72000000:请求错误 |
| msg | str | 错误信息 | 默认为success |
| code | num | 返回值 | 0: 成功<br />4511006: 已跳过无法播放的歌曲<br />7201006:未找到或已下架<br />72000000:请求错误 |
| message | str | 返回值 | 字符串形式的 code |
| msg | str | 返回信息 | 成功为 success |
| data | obj | 数据本体 | |

`data`对象:
Expand All @@ -45,50 +48,49 @@
| --------- | ----- | --------- | --------------------------------------- |
| sid | num | 音频auid | |
| type | num | 音质标识 | -1:试听片段(192K)<br />1:192K |
| info | str | 空 | **作用尚不明确** |
| info | str | 空 | |
| timeout | num | 有效时长 | 单位为秒<br />一般为3h |
| size | num | 文件大小 | 单位为字节<br />当`type`为-1时`size`为0 |
| cdns | array | 音频流url | |
| qualities | null | - | |
| title | null | - | |
| cover | null | - | |
| qualities | null | | |
| title | str | | |
| cover | str | | |

`data`对象的`cdns`数组:


| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | ------------- | ---- |
| 0 | str | 音频流url | |
| 1 | str | 备用音频流url | |
| 1 | str | 备用音频流url | 可能不存在 |

**示例:**

```shell
curl -G 'https://www.bilibili.com/audio/music-service-c/web/url' \
--data-urlencode 'sid=sid=15664'
--data-urlencode 'sid=777180'
```

<details>
<summary>查看响应示例:</summary>

```json
{
"code": 0,
"msg": "success",
"data": {
"sid": 15664,
"type": 1,
"info": "",
"timeout": 10800,
"size": 4853263,
"cdns": [
"https://upos-sz-mirrorkodo.bilivideo.com/ugaxcode/7bf6a3a3e94421ccc653f005457b1e8c-192k.m4a?deadline=1595331310&gen=uga&os=kodobv&uparams=deadline,gen,os&upsig=0ecd3c7a8d9539f260239d8fa4c093db",
"https://upos-sz-mirrorks3.bilivideo.com/ugaxcode/7bf6a3a3e94421ccc653f005457b1e8c-192k.m4a?deadline=1595331310&gen=uga&os=ks3bv&uparams=deadline,gen,os&upsig=f3fe53aff56655b1b7264ae4ab65872e"
],
"qualities": null,
"title": null,
"cover": null
}
"code": 0,
"data": {
"sid": 777180,
"title": "",
"cover": "",
"type": 1,
"info": "",
"timeout": 10800,
"size": 5579903,
"cdns": [
"https://upos-sz-mirrorcos.bilivideo.com/ugaxcode/m190314ws1dikiap1oivtapctuj1agjc-192k.m4a?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1725013547&gen=playurlv2&os=cosbv&oi=1746706124&trid=493923009cef4225ab8e1b9bda42c635B&mid=0&platform=pc&og=cos&upsig=043779511e2770cf6c3da04ed8a89f25&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&bvc=vod&nettype=0&orderid=0,1&logo=00000000"
],
"qualities": null
},
"message": "0",
"msg": "success"
}
```

Expand Down Expand Up @@ -176,7 +178,7 @@ curl -G 'https://www.bilibili.com/audio/music-service-c/web/url' \
Cookie方式:

```shell
curl -G 'https://api.bilibili.com/audio/music-service-c/url
curl -G 'https://api.bilibili.com/audio/music-service-c/url' \
--data-urlencode 'songid=682118' \
--data-urlencode 'quality=3' \
--data-urlencode 'privilege=2' \
Expand All @@ -188,7 +190,7 @@ curl -G 'https://api.bilibili.com/audio/music-service-c/url
APP方式:

```shell
curl -G 'https://api.bilibili.com/audio/music-service-c/url
curl -G 'https://api.bilibili.com/audio/music-service-c/url' \
--data-urlencode 'access_key=xxx' \
--data-urlencode 'songid=682118' \
--data-urlencode 'quality=3' \
Expand Down Expand Up @@ -262,17 +264,16 @@ curl -G 'https://api.bilibili.com/audio/music-service-c/url

## 音频流的获取

将`data`.`cdns`.`[0]`或`data`.`cdns`.`[1]`中的内容作为url进行GET操作
`data.cdns[n]` 作为 URL 进行 GET 操作

需要验证请求`user-agent` 不为空
需要验证请求头 `User-Agent` 不为空且不含敏感字串, 且 `Referer` 必须在 `.bilibili.com` 下

**user-agent错误并且referer不在`*.bilibili.com`域名下的情况下会导致403 Forbidden,故无法获取**
**示例:**

**以上述音频url为例:**
使用 cURL + FFPlay 直接从音频流播放

```shell
wget 'https://upos-sz-mirrorkodo.bilivideo.com/ugaxcode/m190102ws2pzf6jitbem841vq2x0du5x-flac.flac?deadline=1595332269&gen=uga&os=kodobv&uparams=deadline,gen,os&upsig=ac2284d97a61ef8758681eccf621c56d' \
-O 'Download_music.flac'
curl -G "https://upos-sz-mirrorcos.bilivideo.com/ugaxcode/7bf6a3a3e94421ccc653f005457b1e8c-192k.m4a?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1725013121&gen=playurlv2&os=cosbv&oi=1823807031&trid=1a4703f1e7344bb891691c5857e8cfb9B&mid=0&platform=pc&og=cos&upsig=e3a9fba59b46ab2720c8b1807844e9f3&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform,og&bvc=vod&nettype=0&orderid=0,1&logo=00000000" \
--referer 'https://www.bilibili.com/' -A 'Mozilla/5.0' \
--output - | ffplay -
```

响应正文将返回一个flac文件
2 changes: 1 addition & 1 deletion docs/blackroom/jury/judgement_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ curl -G 'https://api.bilibili.com/x/credit/jury/caseList' \

| 字段 | 类型 | 内容 | 备注 |
| ------- | ------ | -------- | ------------------------------------------------- |
| code | num | 返回值 | 0:成功;<br>-400:`ps`参数大于可允许的最大值`20` |
| code | num | 返回值 | 0:成功;<br />-400:`ps`参数大于可允许的最大值`20` |
| message | str | 信息 | 默认为0 |
| ttl | num | 1 | 作用尚不明确 |
| data | object | 数据本体 | |
Expand Down
8 changes: 3 additions & 5 deletions docs/comment/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,6 @@ curl -G 'https://api.bilibili.com/x/v2/reply' \

*请求方式:GET*

认证方式:Cookie(SESSDATA)或APP

鉴权方式:[Wbi 签名](../misc/sign/wbi.md)

注: Wbi 签名错误时返回 -403 而非 -352
Expand All @@ -876,6 +874,7 @@ curl -G 'https://api.bilibili.com/x/v2/reply' \
| type | num | 评论区类型代码 | 必要 | [类型代码见表](readme.md#评论区类型代码) |
| oid | num | 目标评论区 id | 必要 | |
| mode | num | 排序方式 | 非必要 | 默认为 3<br />0 3:仅按热度<br />1:按热度+按时间<br />2:仅按时间 |
| next | num | 翻页 | 非必要 | 不推荐, 已弃用, 优先级比 `pagination_str` 高 |
| pagination_str | obj | 分页信息 | 非必要 | 见下 |
| plat | num | 平台类型 | 非必要 | 如 `1` |
| seek_rpid | str | 空 | 非必要 | 当获取第一页评论时存在 |
Expand All @@ -892,7 +891,7 @@ curl -G 'https://api.bilibili.com/x/v2/reply' \
| 参数名 | 类型 | 内容 | 备注 |
| ----- | ---- | -- | - |
| type | num | 类型 | 当 URL 参数 mode 为 2 时, 此项为 3<br />当 URL 参数 mode 为 3 时, 此项为 1 |
| direction | num | 1 | |
| direction | num | 方向 | 1: 正序(默认)<br />2: 倒序 |
| data | obj | 分页数据 | 当 type 为 1 时存在 |
| Data | obj | 分页数据 | 当 type 为 3 时存在 |
<!--not typo here-->
Expand Down Expand Up @@ -1054,8 +1053,7 @@ curl -G 'https://api.bilibili.com/x/v2/reply/wbi/main' \
--data-urlencode 'type=1' \
--data-urlencode 'mode=2' \
--data-urlencode 'w_rid=xxx' \
--data-urlencode 'wts=xxx' \
-b 'SESSDATA='
--data-urlencode 'wts=xxx'
```

<details>
Expand Down
2 changes: 1 addition & 1 deletion docs/comment/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
| count | num | 二级评论条数 | |
| rcount | num | 回复评论条数 | |
| floor | num | 评论楼层号 | **注:若不支持楼层则无此项** |
| state | num | (?) | |
| state | num | 评论状态 | 0: 正常<br />17: 被阿瓦隆系统隐藏 (无法被别人看到, 只能自己看到) |
| fansgrade | num | 是否具有粉丝标签 | 0:无<br />1:有 |
| attr | num | 某属性位? | |
| ctime | num | 评论发送时间 | 时间戳 |
Expand Down
2 changes: 1 addition & 1 deletion docs/creativecenter/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ JavaScript (Node.js) 请求[示例](https://gist.github.com/SessionHu/5e47a3a1a3
curl -X POST --url 'https://member.bilibili.com/x/vupre/web/archive/types/predict' \
--url-query 'csrf=d51eadf05ba3bc6c5f76def7fbcc0185' \
--data-urlencode 'filename=' \
-b '
-b 'SESSDATA=xxx; bili_jct=xxx'
```

<details>
Expand Down
2 changes: 1 addition & 1 deletion docs/danmaku/action.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ curl 'https://api.bilibili.com/x/v2/dm/command/post' \
`data`对象:

| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- |
| ---- | ---- | ---- | ---- |
| dmid | num | 弹幕dmid | |
| dmid_str | str | 弹幕dmid | 字串形式 |
| visible | bool | 是否可见 | |
Expand Down
Loading