Merge branch 'master' into master

This commit is contained in:
小宇 2025-04-13 11:30:44 +08:00 committed by GitHub
commit 06e11ba41e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 1618 additions and 74 deletions

View File

@ -728,3 +728,185 @@ curl -X POST 'https://member.bilibili.com/x2/creative/web/season/del' \
```
</details>
## 获取合集中的视频
可以在给合集排序时使用
> https://member.bilibili.com/x2/creative/web/season/section?id=3898622
*请求方式: POST*
认证方式: Cookie (SESSDATA)
**正文参数 (application/x-www-form-urlencoded):**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ----- | --- | ---- | ----- | --- |
| id | num | 合集 ID | 必要 | |
**JSON回复:**
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ---- |
| code | num | 返回值 | 0成功 |
| message | str | 错误信息 | |
| ttl | num | 1 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| --------- | ---- | ------------ | ---- |
| seasons | obj | 合集信息 | |
| episodes | arr | 合集中的视频 | |
`seasons`对象:
| 字段 | 类型 | 内容 | 备注 |
| --------- | ---- | ------------ | ---- |
| id | num | 合集 ID | |
| type | num | 合集类型 | |
| cover | str | 合集封面 URL | |
| isEnd | num | 是否已完结? | 0: 未完结 |
| state | num | 合集状态? | 0: 正常显示<br />-6: 正在审核 |
| partState | num | 合集分段状态? | 0 |
| rejectReason | str | 合集拒绝原因? | |
| ctime | num | 创建时间 | |
| mtime | num | 修改时间 | |
| epCount | num | 视频总数 | |
| show | num | 是否公开? | 1: 公开 |
| has_charging_pay | num | 是否充电付费? | 0: 否 |
`episodes`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| --------- | ---- | ------------ | ---- |
| id | num | 合集内视频 ID | |
| title | str | 视频标题 | |
| aid | num | 视频 aid | |
| bvid | str | 视频 bvid | |
| cid | num | 视频 cid | |
| seasonId | num | 合集 ID | |
| sectionId | num | 小节 ID | |
| order | num | 排序编号 | |
| videoTitle | str | 视频标题 | |
| archiveTitle | str | 看起来也是标题 | |
| archiveState | num | 0 | |
| rejectReason | str | 拒绝理由? | |
| state | num | 0 | |
| cover | str | 封面 URL | |
| is_free | num | 是否免费? | 0: 免费 |
| aid_owner | bool | 是否视频所有者 | true:是所有者 |
| charging_pay | num | 充电付费? | 0: 否 |
**示例:**
获取合集176088的视频列表 `id=3541327`
```shell
curl -X GET 'https://member.bilibili.com/x2/creative/web/season/section?id=176088' \
-b 'SESSDATA=xxx; bili_jct=xxx'
```
<details>
<summary>查看响应示例:</summary>
会返回全部的,由于很长,这里只保留三个作为例子
```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"section": {
"id": 176088,
"type": 1,
"seasonId": 152812,
"title": "正片",
"order": 1,
"state": 0,
"partState": 0,
"rejectReason": "",
"ctime": 1643250822,
"mtime": 1739466002,
"epCount": 112,
"cover": "http://i1.hdslb.com/bfs/archive/4439a182b142d92a169609e6e14e7217b3e14e0d.jpg",
"has_charging_pay": 0,
"Episodes": null,
"show": 1,
"has_pugv_pay": 0
},
"episodes": [
{
"id": 109100674,
"title": "「开箱评测」三星Note8 EMR2笔对比公版Wacom笔 套娃笔首选 10寸 RK PX30 Wacom 电子书 天喻墨学 M2 M3",
"aid": 113997323963614,
"bvid": "BV14BNfeSE5c",
"cid": 28376042631,
"seasonId": 152812,
"sectionId": 176088,
"order": 1,
"videoTitle": "「开箱评测」三星Note8 EMR2笔对比公版Wacom笔 套娃笔首选 10寸 RK PX30 Wacom 电子书 天喻墨学 M2 M3",
"archiveTitle": "「开箱评测」三星Note8 EMR2笔对比公版Wacom笔 套娃笔首选 10寸 RK PX30 Wacom 电子书 天喻墨学 M2 M3",
"archiveState": 0,
"rejectReason": "",
"state": 0,
"cover": "",
"is_free": 0,
"aid_owner": true,
"charging_pay": 0,
"member_first": 0,
"pugv_pay": 0
},
{
"id": 108733886,
"title": "「开箱评测」拆解 椭圆形的第三方AirTag GRTSZ S2 Tag",
"aid": 113982291576104,
"bvid": "BV1YyNvetEbX",
"cid": 28325121446,
"seasonId": 152812,
"sectionId": 176088,
"order": 2,
"videoTitle": "「开箱评测」拆解 椭圆形的第三方AirTag GRTSZ S2 Tag",
"archiveTitle": "「开箱评测」拆解 椭圆形的第三方AirTag GRTSZ S2 Tag",
"archiveState": 0,
"rejectReason": "",
"state": 0,
"cover": "",
"is_free": 0,
"aid_owner": true,
"charging_pay": 0,
"member_first": 0,
"pugv_pay": 0
},
{
"id": 106045797,
"title": "「开箱评测」这帕姆怎么射不出来呢! 星穹铁道 KFC联动 财神帕姆 太可爱了",
"aid": 113892936122993,
"bvid": "BV1ZFFKeTEkr",
"cid": 28087484764,
"seasonId": 152812,
"sectionId": 176088,
"order": 3,
"videoTitle": "「开箱评测」这帕姆怎么射不出来呢! 星穹铁道 KFC联动 财神帕姆 太可爱了",
"archiveTitle": "「开箱评测」这帕姆怎么射不出来呢! 星穹铁道 KFC联动 财神帕姆 太可爱了",
"archiveState": 0,
"rejectReason": "",
"state": 0,
"cover": "",
"is_free": 0,
"aid_owner": true,
"charging_pay": 0,
"member_first": 0,
"pugv_pay": 0
}
]
}
}
```
</details>

View File

@ -12,7 +12,7 @@
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|----- |--- |------- |----- |--- |
| keyword | str | 关键词 | 不必要 | |
| key_word | str | 关键词 | 不必要 | |
| ps | int | 每页返回数据的最大值 | 不必要 | |
| pn | int | 当前页数 | 不必要 | |
@ -137,11 +137,11 @@
**示例:**
搜索关键词为 `2233`, 然而没有结果:
搜索关键词为 `2233`:
```shell
curl -G 'https://api.bilibili.com/x/garb/v2/mall/home/search' \
--data-urlencode 'keyword=2233' \
--data-urlencode 'key_word=2233' \
-b 'SESSDATA=xxx'
```
@ -150,15 +150,469 @@ curl -G 'https://api.bilibili.com/x/garb/v2/mall/home/search' \
```json
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"list": null,
"pn": 1,
"ps": 20,
"total": 0
}
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"list": [
{
"item_id": 0,
"name": "2024拜年纪-2233拜年画册",
"group_id": 70,
"group_name": "2024拜年纪-2233拜年画册",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "1395313",
"dlc_act_id": "279",
"dlc_act_status": "2",
"dlc_is_free": "0",
"dlc_lottery_id": "256",
"dlc_lottery_sale_quantity": "313028",
"dlc_lottery_type": "1",
"dlc_sale_end_time": "2114406245",
"dlc_sale_mode": "1",
"dlc_sale_start_time": "1707458400",
"dlc_surplus_stock": "0",
"image_cover": "http://i0.hdslb.com/bfs/archive/f96a8cf6866ccef8f54de4773acf0cb07b915ac6.png",
"sale_bp_forever_raw": "990",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": {
"type": "first_draw_discount",
"time_limit": false,
"time_left": -1728418723,
"tag": "大会员首抽",
"price_bp_month": 490,
"price_bp_forever": 490,
"type_month": "",
"tag_month": "",
"time_limit_month": false,
"time_left_month": 0
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "31万+",
"total_count_desc": "已售31万+份",
"tag": "",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=279\u0026hybrid_set_header=2\u0026lottery_id=256",
"sales_mode": 0
},
{
"item_id": 0,
"name": "2024 BML\u0026BW 2233收藏集-2233福利卡池",
"group_id": 70,
"group_name": "2024 BML\u0026BW 2233收藏集-2233福利卡池",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "4376",
"dlc_act_id": "102962",
"dlc_act_status": "2",
"dlc_is_free": "1",
"dlc_lottery_id": "102966",
"dlc_lottery_sale_quantity": "2677",
"dlc_lottery_type": "2",
"dlc_sale_end_time": "1729828800",
"dlc_sale_mode": "2",
"dlc_sale_start_time": "1721876400",
"dlc_surplus_stock": "0",
"image_cover": "https://i0.hdslb.com/bfs/garb/4a374316b1e9a07cffeccbdeff585c472dcdcc26.png",
"sale_bp_forever_raw": "0",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": null,
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "2千+",
"total_count_desc": "已发放2千+份",
"tag": "限时DLC",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=102962\u0026hybrid_set_header=2\u0026lottery_id=102966",
"sales_mode": 0
},
{
"item_id": 0,
"name": "2233·幻境序曲-长夜",
"group_id": 70,
"group_name": "2233·幻境序曲-长夜",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "228065",
"dlc_act_id": "102161",
"dlc_act_status": "2",
"dlc_is_free": "0",
"dlc_lottery_id": "103087",
"dlc_lottery_sale_quantity": "71200",
"dlc_lottery_type": "2",
"dlc_sale_end_time": "2114406245",
"dlc_sale_mode": "1",
"dlc_sale_start_time": "1722139200",
"dlc_surplus_stock": "0",
"image_cover": "https://i0.hdslb.com/bfs/garb/f7e4f434ba6b93434b9e60df3c57a07552af4ca1.png",
"sale_bp_forever_raw": "990",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": {
"type": "first_draw_discount",
"time_limit": false,
"time_left": -1728418723,
"tag": "大会员首抽",
"price_bp_month": 490,
"price_bp_forever": 490,
"type_month": "",
"tag_month": "",
"time_limit_month": false,
"time_left_month": 0
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "7万+",
"total_count_desc": "已售7万+份",
"tag": "DLC池",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=102161\u0026hybrid_set_header=2\u0026lottery_id=103087",
"sales_mode": 0
},
{
"item_id": 0,
"name": "2233·群星闪耀时-双子座",
"group_id": 70,
"group_name": "2233·群星闪耀时-双子座",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "1164544",
"dlc_act_id": "113",
"dlc_act_status": "2",
"dlc_is_free": "0",
"dlc_lottery_id": "16",
"dlc_lottery_sale_quantity": "572712",
"dlc_lottery_type": "1",
"dlc_sale_end_time": "2114406245",
"dlc_sale_mode": "1",
"dlc_sale_start_time": "1686196800",
"dlc_surplus_stock": "0",
"image_cover": "http://i0.hdslb.com/bfs/archive/ed35d12a3dce7764d6cb5b02cb4a459373472522.jpg",
"sale_bp_forever_raw": "990",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": {
"type": "first_draw_discount",
"time_limit": false,
"time_left": -1728418723,
"tag": "大会员首抽",
"price_bp_month": 90,
"price_bp_forever": 90,
"type_month": "",
"tag_month": "",
"time_limit_month": false,
"time_left_month": 0
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "57万+",
"total_count_desc": "已售57万+份",
"tag": "",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=113\u0026hybrid_set_header=2\u0026lottery_id=16",
"sales_mode": 0
},
{
"item_id": 39389,
"name": "2233人生百戏-花木兰",
"group_id": 70,
"group_name": "2233人生百戏-花木兰",
"part_id": 6,
"state": "active",
"properties": {
"desc": "为从军设妙计女扮男装涉千山越万水亲赴戎机。2233人生百戏·花木兰装扮上线啦本套装包括动态卡片、点赞动效和表情包永久购买还能成为认证粉丝领取粉丝专属装扮",
"fan_desc": "人生百戏-花木兰",
"fan_id": "人生百戏-花木兰",
"fan_item_ids": "39335,39384,39353,39354",
"fan_mid": "35365327",
"fan_no_color": "#eb3d3e",
"fan_recommend_desc": "为从军设妙计女扮男装,涉千山越万水亲赴戎机。",
"fan_recommend_jump_type": "url",
"fan_recommend_jump_value": "https://space.bilibili.com/35365327?spm_id_from=333.337.0.0",
"fan_share_image": "https://i0.hdslb.com/bfs/garb/item/5ddd3f72ef2a938e9125851f488068012b841ad4.jpg",
"gray_rule": "true",
"gray_rule_type": "all",
"image_cover": "https://i0.hdslb.com/bfs/garb/item/e21ec12047bcd93e6afb8e52a68eb9835cd54a23.jpg",
"image_cover_color": "#d8b796",
"is_hide": "false",
"item_id_card": "39334",
"item_id_emoji": "39352",
"item_id_thumbup": "39336",
"open_platform_vip_discount": "true",
"owner_uid": "647193094",
"rank_investor_show": "false",
"realname_auth": "false",
"sale_bp_forever_raw": "5000",
"sale_bp_pm_raw": "800",
"sale_buy_num_limit": "100",
"sale_quantity": "20000",
"sale_quantity_limit": "true",
"sale_region_ip_limit": "全球",
"sale_reserve_switch": "false",
"sale_time_begin": "1666868400",
"sale_type": "pay",
"suit_card_type": "big_img",
"type": "ip"
},
"current_activity": null,
"next_activity": {
"type": "open_platform_vip_discount",
"time_limit": true,
"time_left": 417469277,
"tag": "大会员平台折扣",
"price_bp_month": 640,
"price_bp_forever": 4000,
"type_month": "open_platform_vip_discount",
"tag_month": "大会员平台折扣",
"time_limit_month": true,
"time_left_month": 417469277
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -61550323,
"sale_time_end": -1728418723,
"sale_surplus": 8650,
"sale_count_desc": "1万+",
"total_count_desc": "已售1万+份",
"tag": "",
"jump_link": "https://www.bilibili.com/h5/mall/suit/detail?navhide=1\u0026id=39389",
"sales_mode": 0
},
{
"item_id": 4259,
"name": "2233白色情人节",
"group_id": 70,
"group_name": "2233白色情人节",
"part_id": 6,
"state": "active",
"properties": {
"desc": "shot你的心——无论是谁都拥有爱的权利快换上白色情人节专属装扮来遇见心里的那个ta吧本套装包括头像挂件、动态卡片、点赞动效和表情包永久购买还能成为认证粉丝领取粉丝专属装扮",
"fan_desc": "白色情人节",
"fan_id": "2233白色情人节",
"fan_item_ids": "4257,4230,4256,4255,4253,4254",
"fan_mid": "174501086",
"fan_no_color": "#f85574",
"fan_recommend_desc": "平淡日常中迎来浪漫的节日,象征爱情的丘比特们悄悄来到少女们身边,用爱之箭觉醒了懵懂悸动的心。新鲜的玫瑰,闪耀光泽的草莓,白色情人节这天为你准备不一样的惊喜。",
"fan_recommend_jump_type": "url",
"fan_recommend_jump_value": "https://b23.tv/54WVWS",
"fan_share_image": "https://i0.hdslb.com/bfs/garb/item/30e3f1b234dd33a2a5446dd7d05b31835ac74d4b.jpg",
"gray_rule": "true",
"gray_rule_type": "all",
"image_cover": "https://i0.hdslb.com/bfs/garb/item/a8d60a7d4f1f5a5de667b307736f701cb39c0741.jpg",
"image_cover_color": "#a3a8ec",
"image_cover_long": "https://i0.hdslb.com/bfs/garb/item/5ac3bb024d42ff0f26de07ce974351d62587c6ea.jpg",
"image_desc": "https://i0.hdslb.com/bfs/garb/item/cfe753a010d124a95fb311c372a5be69d82c8e13.jpg",
"is_hide": "false",
"item_id_card": "4231",
"item_id_emoji": "4252",
"item_id_pendant": "4229",
"item_id_thumbup": "4232",
"open_platform_vip_discount": "true",
"owner_uid": "647193094",
"rank_investor_show": "true",
"realname_auth": "false",
"sale_bp_forever_raw": "5900",
"sale_bp_pm_raw": "800",
"sale_buy_num_limit": "100",
"sale_quantity": "52000",
"sale_quantity_limit": "true",
"sale_region_ip_limit": "全球",
"sale_reserve_switch": "false",
"sale_time_begin": "1615694400",
"sale_type": "pay",
"suit_card_type": "big_img",
"type": "ip"
},
"current_activity": null,
"next_activity": {
"type": "open_platform_vip_discount",
"time_limit": true,
"time_left": 417469277,
"tag": "大会员平台折扣",
"price_bp_month": 640,
"price_bp_forever": 4720,
"type_month": "open_platform_vip_discount",
"tag_month": "大会员平台折扣",
"time_limit_month": true,
"time_left_month": 417469277
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -112724323,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "5万+",
"total_count_desc": "已售5万+份",
"tag": "粉丝套装已售罄",
"jump_link": "https://www.bilibili.com/h5/mall/suit/detail?navhide=1\u0026id=4259",
"sales_mode": 0
},
{
"item_id": 0,
"name": "2233·少女日记-蔚蓝幻想曲",
"group_id": 70,
"group_name": "2233·少女日记-蔚蓝幻想曲",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "100310",
"dlc_act_id": "103244",
"dlc_act_status": "2",
"dlc_is_free": "0",
"dlc_lottery_id": "103885",
"dlc_lottery_sale_quantity": "16563",
"dlc_lottery_type": "2",
"dlc_sale_end_time": "2114406245",
"dlc_sale_mode": "1",
"dlc_sale_start_time": "1727236800",
"dlc_surplus_stock": "0",
"image_cover": "http://i0.hdslb.com/bfs/archive/a04b3e9ef354493a0890a9197412f1c77e01ba0f.jpg",
"sale_bp_forever_raw": "990",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": {
"type": "first_draw_discount",
"time_limit": false,
"time_left": -1728418723,
"tag": "大会员首抽",
"price_bp_month": 490,
"price_bp_forever": 490,
"type_month": "",
"tag_month": "",
"time_limit_month": false,
"time_left_month": 0
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "1万+",
"total_count_desc": "已售1万+份",
"tag": "DLC池",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=103244\u0026hybrid_set_header=2\u0026lottery_id=103885",
"sales_mode": 0
},
{
"item_id": 0,
"name": "2233·少女日记-十四岁生日",
"group_id": 70,
"group_name": "2233·少女日记-十四岁生日",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "100310",
"dlc_act_id": "103244",
"dlc_act_status": "2",
"dlc_is_free": "0",
"dlc_lottery_id": "103247",
"dlc_lottery_sale_quantity": "83747",
"dlc_lottery_type": "1",
"dlc_sale_end_time": "2114406245",
"dlc_sale_mode": "1",
"dlc_sale_start_time": "1723780800",
"dlc_surplus_stock": "0",
"image_cover": "https://i0.hdslb.com/bfs/garb/9c338eb4841cad917665140cc08c7d14b5c7e0bf.png",
"sale_bp_forever_raw": "990",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": {
"type": "first_draw_discount",
"time_limit": false,
"time_left": -1728418723,
"tag": "大会员首抽",
"price_bp_month": 490,
"price_bp_forever": 490,
"type_month": "",
"tag_month": "",
"time_limit_month": false,
"time_left_month": 0
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "8万+",
"total_count_desc": "已售8万+份",
"tag": "",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=103244\u0026hybrid_set_header=2\u0026lottery_id=103247",
"sales_mode": 0
},
{
"item_id": 0,
"name": "2024 BML\u0026BW 2233收藏集-BML\u0026BW2024",
"group_id": 70,
"group_name": "2024 BML\u0026BW 2233收藏集-BML\u0026BW2024",
"part_id": 0,
"state": "active",
"properties": {
"book_amount": "4376",
"dlc_act_id": "102962",
"dlc_act_status": "2",
"dlc_is_free": "0",
"dlc_lottery_id": "102963",
"dlc_lottery_sale_quantity": "1699",
"dlc_lottery_type": "1",
"dlc_sale_end_time": "2114406245",
"dlc_sale_mode": "1",
"dlc_sale_start_time": "1721876400",
"dlc_surplus_stock": "0",
"image_cover": "https://i0.hdslb.com/bfs/garb/6c2d68faf143c33b484b110e2221ab15a0a1f85c.png",
"sale_bp_forever_raw": "990",
"type": "dlc_act"
},
"current_activity": null,
"next_activity": {
"type": "first_draw_discount",
"time_limit": false,
"time_left": -1728418723,
"tag": "大会员首抽",
"price_bp_month": 490,
"price_bp_forever": 490,
"type_month": "",
"tag_month": "",
"time_limit_month": false,
"time_left_month": 0
},
"current_sources": null,
"finish_sources": null,
"sale_left_time": -1728418723,
"sale_time_end": -1728418723,
"sale_surplus": 0,
"sale_count_desc": "1千+",
"total_count_desc": "已售1千+份",
"tag": "",
"jump_link": "https://www.bilibili.com/h5/mall/digital-card/home?-Abrowser=live\u0026act_id=102962\u0026hybrid_set_header=2\u0026lottery_id=102963",
"sales_mode": 0
}
],
"pn": 1,
"ps": 20,
"total": 187
}
}
```

View File

@ -152,7 +152,7 @@ curl 'https://api.live.bilibili.com/room/v1/Room/update' \
| -------- | ---- | ------------------------ | ------ | ----------------------------------- |
| room_id | num | 直播间id | 必要 | 必须为自己的直播间id |
| area_v2 | num | 直播分区id子分区id | 必要 | 详见[直播分区](live_area.md) |
| platform | str | 直播平台 | 必要 | web端<br />bililinkandroid_link |
| platform | str | 直播平台 | 必要 | 直播姬pcpc_link<br />web端<br />bililinkandroid_link |
| csrf | str | CSRF Token位于cookie | 必要 | |
**json回复**

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
| tuid | str | 要禁言的uid | 必要 | |
| msg | str | 要禁言的弹幕内容 | 非必要 | |
| mobile_app | str | web | 必要 | 定值"web"即可 |
| hour | num | 禁言时长 | 必要 | -1为永久0为本场直播 |
| csrf_token | str | CSRF Token | 必要 | cookie中的bili_jct字段 |
| csrf | str | CSRF Token | 必要 | cookie中的bili_jct字段 |
| visit_id | str | 不明 | 非必要 | |

View File

@ -181,7 +181,7 @@ $.ajax({
</details>
## 直播签到
## ~~直播签到(已下线)~~
> https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign
@ -200,6 +200,23 @@ _请求方式GET_
| message | str | 错误信息 | 默认为当日签到奖励内容 |
| data | obj | 信息本体 | 默认为空 |
(目前已下线)
<details>
<summary>查看响应示例(下线后):</summary>
```json
{
"code": 1,
"message": "签到活动已下线,无法使用。",
"ttl": 1,
"data": null
}
```
</details>
## 本月直播签到信息
> https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/WebGetSignInfo

View File

@ -138,14 +138,14 @@ curl 'https://api.bilibili.com/x/member/web/exp/reward' \
## 查询每日投币获得经验数
>https://www.bilibili.com/plus/account/exp.php
> ~~https://www.bilibili.com/plus/account/exp.php~~ (已失效)
>
> https://api.bilibili.com/x/web-interface/coin/today/exp
*请求方式GET*
认证方式仅可CookieSESSDATA
鉴权方式Cookie中`DedeUserID`存在且不为0
该接口实时更新,未发现延迟
**json回复**
@ -156,13 +156,13 @@ curl 'https://api.bilibili.com/x/member/web/exp/reward' \
| ------- | ---- | -------------------- | ----------- |
| code | num | 返回值 | 0成功 |
| message | str | 错误信息 | 默认为0 |
| number | num | 每日投币所奖励的经验 | 上限为50 |
| data | num | 每日投币所奖励的经验 | 上限为50 |
**示例:**
```shell
curl 'https://www.bilibili.com/plus/account/exp.php' \
-b 'SESSDATA=xxx;DedeUserID=1'
curl 'https://api.bilibili.com/x/web-interface/coin/today/exp' \
-b 'SESSDATA=xxx'
```
<details>
@ -172,7 +172,8 @@ curl 'https://www.bilibili.com/plus/account/exp.php' \
{
"code": 0,
"message": "0",
"number": 20
"ttl": 1,
"data": 20
}
```

View File

@ -1108,9 +1108,9 @@ mod tests {
需要 [Alamofire](https://github.com/Alamofire/Alamofire) 和 [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) 库
```swift
import Foundation
import CommonCrypto
import Alamofire
import CommonCrypto
import Foundation
import SwiftyJSON
func biliWbiSign(param: String, completion: @escaping (String?) -> Void) {
@ -1124,35 +1124,39 @@ func biliWbiSign(param: String, completion: @escaping (String?) -> Void) {
let currTime = round(Date().timeIntervalSince1970)
params["wts"] = currTime
params = params.sorted { $0.key < $1.key }.reduce(into: [:]) { $0[$1.key] = $1.value }
params = params.mapValues { String(describing: $0).filter { !"!'()*".contains($0) } }
params = params.mapValues { value in
if let doubleValue = value as? Double, doubleValue.truncatingRemainder(dividingBy: 1) == 0 {
return String(Int(doubleValue)).filter { !"!'()*".contains($0) }
}
return String(describing: value).filter { !"!'()*".contains($0) }
}
let query = params.map { "\($0.key)=\($0.value)" }.joined(separator: "&")
let wbiSign = calculateMD5(string: query + mixinKey)
params["w_rid"] = wbiSign
return params
}
func getWbiKeys(completion: @escaping (Result<(imgKey: String, subKey: String), Error>) -> Void) {
let headers: HTTPHeaders = [
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"Referer": "https://www.bilibili.com/"
]
func getWbiKeys(completion: @escaping (Result<(imgKey: String, subKey: String), Error>) -> Void) {
let headers: HTTPHeaders = [
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"Referer": "https://www.bilibili.com/"
]
AF.request("https://api.bilibili.com/x/web-interface/nav", headers: headers).responseJSON { response in
switch response.result {
case .success(let value):
let json = JSON(value)
let imgURL = json["data"]["wbi_img"]["img_url"].string ?? ""
let subURL = json["data"]["wbi_img"]["sub_url"].string ?? ""
let imgKey = imgURL.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? ""
let subKey = subURL.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? ""
completion(.success((imgKey, subKey)))
case .failure(let error):
completion(.failure(error))
}
}
}
AF.request("https://api.bilibili.com/x/web-interface/nav", headers: headers).responseJSON { response in
switch response.result {
case .success(let value):
let json = JSON(value)
let imgURL = json["data"]["wbi_img"]["img_url"].string ?? ""
let subURL = json["data"]["wbi_img"]["sub_url"].string ?? ""
let imgKey = imgURL.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? ""
let subKey = subURL.components(separatedBy: "/").last?.components(separatedBy: ".").first ?? ""
completion(.success((imgKey, subKey)))
case .failure(let error):
completion(.failure(error))
}
}
}
func calculateMD5(string: String) -> String {
let data = Data(string.utf8)
var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH))
@ -1174,7 +1178,7 @@ func biliWbiSign(param: String, completion: @escaping (String?) -> Void) {
case .success(let keys):
let spdParam = param.components(separatedBy: "&")
var spdDicParam = [String: String]()
spdParam.forEach { pair in
for pair in spdParam {
let components = pair.components(separatedBy: "=")
if components.count == 2 {
spdDicParam[components[0]] = components[1]
@ -1191,6 +1195,22 @@ func biliWbiSign(param: String, completion: @escaping (String?) -> Void) {
}
}
// 使用示例
biliWbiSign(param: "bar=514&foo=114&zab=1919810") {
signedQuery in
if let signedQuery = signedQuery {
print("签名后的参数: \(signedQuery)")
} else {
print("签名失败")
}
}
RunLoop.main.run()//程序类型为命令行程序时需要添加这行代码
```
```text
签名后的参数: bar=514&wts=1741082093&foo=114&zab=1919810&w_rid=04775bb3debbb45bab86a93a1c08d12a
```

View File

@ -1,6 +1,9 @@
# 检查昵称是否可注册
## 检查昵称
## ~~检查昵称(已失效)~~
<details>
<summary>查看折叠内容</summary>
> https://passport.bilibili.com/web/generic/check/nickname
@ -131,3 +134,12 @@ curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
```
</details>
</details>
目前该接口无论参数,稳定返回:
```json
{
"code": 0
}
```

View File

@ -8,6 +8,8 @@
*请求方式: GET*
认证方式CookieSESSDATA
鉴权方式:[Wbi 签名](../misc/sign/wbi.md)
**url参数**
@ -27,7 +29,7 @@
| 字段 | 类型 | 内容 | 备注 |
|---------|-----|------|--------------------------|
| code | num | 返回值 | 0: 成功<br />-400请求错误<br /> -403: 访问权限不足 |
| code | num | 返回值 | 0: 成功<br />-101: 账号未登录<br />-400请求错误<br /> -403: 访问权限不足 |
| message | str | 错误信息 | 默认为0 |
| ttl | num | 1 | |
| data | obj | 数据本体 | |