From 1a60eb8a0d01606fa904726510add646bb0d687d Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Wed, 9 Oct 2024 04:13:07 +0800 Subject: [PATCH 01/33] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A3=85?= =?UTF-8?q?=E6=89=AE/=E6=94=B6=E8=97=8F=E9=9B=86=E6=90=9C=E7=B4=A2API?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=90=8D=E7=A7=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/garb/lottery.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/garb/lottery.md b/docs/garb/lottery.md index 861d874..36b2825 100644 --- a/docs/garb/lottery.md +++ b/docs/garb/lottery.md @@ -12,7 +12,7 @@ | 参数名 | 类型 | 内容 | 必要性 | 备注 | |----- |--- |------- |----- |--- | -| keyword | str | 关键词 | 不必要 | | +| key_word | str | 关键词 | 不必要 | | | ps | int | 每页返回数据的最大值 | 不必要 | | | pn | int | 当前页数 | 不必要 | | @@ -141,7 +141,7 @@ ```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' ``` From 7a60bba6efe38ed87f121fb636e3139db6c8dfa0 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Wed, 9 Oct 2024 04:21:11 +0800 Subject: [PATCH 02/33] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A3=85?= =?UTF-8?q?=E6=89=AE/=E6=94=B6=E8=97=8F=E9=9B=86=E6=90=9C=E7=B4=A2API?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/garb/lottery.md | 460 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 457 insertions(+), 3 deletions(-) diff --git a/docs/garb/lottery.md b/docs/garb/lottery.md index 36b2825..5b22d56 100644 --- a/docs/garb/lottery.md +++ b/docs/garb/lottery.md @@ -137,7 +137,7 @@ **示例:** -搜索关键词为 `2233`, 然而没有结果: +搜索关键词为 `2233`: ```shell curl -G 'https://api.bilibili.com/x/garb/v2/mall/home/search' \ @@ -154,10 +154,464 @@ curl -G 'https://api.bilibili.com/x/garb/v2/mall/home/search' \ "message": "0", "ttl": 1, "data": { - "list": null, + "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": 0 + "total": 187 } } ``` From 1f4465ab5e99cff81d3e7903f3195afbb34e3826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=AD=90=E6=96=B9=E8=BE=B0?= Date: Sun, 17 Nov 2024 00:40:04 -0500 Subject: [PATCH 03/33] =?UTF-8?q?=E7=A6=81=E8=A8=80=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E5=8F=82=E6=95=B0hour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/live/silent_user_manage.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/live/silent_user_manage.md b/docs/live/silent_user_manage.md index 08f7757..0daa299 100644 --- a/docs/live/silent_user_manage.md +++ b/docs/live/silent_user_manage.md @@ -18,6 +18,7 @@ | tuid | str | 要禁言的uid | 必要 | | | msg | str | 要禁言的弹幕内容 | 非必要 | | | mobile_app | str | web | 必要 | 定值"web"即可 | +| hour | str | 禁言时长 | 必要 | -1为永久,0为本场直播 | | csrf_token | str | CSRF Token | 必要 | cookie中的bili_jct字段 | | csrf | str | CSRF Token | 必要 | cookie中的bili_jct字段 | | visit_id | str | 不明 | 非必要 | | From 5e16f1c41d8c6a6487d9e690f0b33a6d5f072c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A9=BA=E8=8A=BD?= <74719559+emptyBud@users.noreply.github.com> Date: Sun, 19 Jan 2025 20:05:26 +0800 Subject: [PATCH 04/33] Update check_nickname.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 弃用检查昵称接口(该接口已弃用) --- docs/user/check_nickname.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/user/check_nickname.md b/docs/user/check_nickname.md index 139161b..b006dbc 100644 --- a/docs/user/check_nickname.md +++ b/docs/user/check_nickname.md @@ -1,6 +1,9 @@ # 检查昵称是否可注册 -## 检查昵称 +## ~~检查昵称(已失效)~~ + +
+查看折叠内容 > https://passport.bilibili.com/web/generic/check/nickname @@ -131,3 +134,12 @@ curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \ ```
+ + + +目前该接口无论参数,稳定返回: +```json +{ + "code": 0 +} +``` From 427df2277101c9883b56f9721c2acfa66f763db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A9=BA=E8=8A=BD?= <74719559+emptyBud@users.noreply.github.com> Date: Sun, 19 Jan 2025 20:09:41 +0800 Subject: [PATCH 05/33] Update user.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 直播签到接口下线 --- docs/live/user.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/live/user.md b/docs/live/user.md index dec1db9..9a6fb5f 100644 --- a/docs/live/user.md +++ b/docs/live/user.md @@ -181,7 +181,7 @@ $.ajax({ -## 直播签到 +## ~~直播签到(已下线)~~ > https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign @@ -200,6 +200,23 @@ _请求方式:GET_ | message | str | 错误信息 | 默认为当日签到奖励内容 | | data | obj | 信息本体 | 默认为空 | +(目前已下线) + +
+查看响应示例(下线后): + +```json +{ + "code": 1, + "message": "签到活动已下线,无法使用。", + "ttl": 1, + "data": null +} +``` + +
+ + ## 本月直播签到信息 > https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/WebGetSignInfo From fab50db0394cd6e0b822dcee1534ff359079b7a0 Mon Sep 17 00:00:00 2001 From: Sparkle <16502567+zanjie1999@users.noreply.github.com> Date: Mon, 17 Feb 2025 23:18:41 +0800 Subject: [PATCH 06/33] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=90=88=E9=9B=86=E4=B8=AD=E7=9A=84=E8=A7=86=E9=A2=91=20?= =?UTF-8?q?=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/creativecenter/season.md | 182 ++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/docs/creativecenter/season.md b/docs/creativecenter/season.md index 694ff4c..55e6057 100644 --- a/docs/creativecenter/season.md +++ b/docs/creativecenter/season.md @@ -728,3 +728,185 @@ curl -X POST 'https://member.bilibili.com/x2/creative/web/season/del' \ ``` + +## 获取合集中的视频 + +可以在给合集排序时使用 + +> 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: 正常显示
-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' +``` + +
+查看响应示例: + +会返回全部的,由于很长,这里只保留三个作为例子 + +```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 + } + ] + } +} +``` + +
+ From 1f33153c0d769fa60ab709896c20d06f5dd55312 Mon Sep 17 00:00:00 2001 From: pskdje <77605497+pskdje@users.noreply.github.com> Date: Sat, 8 Mar 2025 20:09:07 +0800 Subject: [PATCH 07/33] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=B5=81=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复部分HTML标签未正确闭合; 修复DANMU_MSG的一个中括号方向不正确; 添加和调整了一些与登录相关的描述。 部分信息来自我写的 https://github.com/SocialSisterYi/bilibili-API-collect/issues/1139 cmd变更整理: DANMU_MSG (小) DM_INTERACTION INTERACT_WORD (小) PREPARING LIVE LOG_IN_NOTICE (新) ROOM_CHANGE ROOM_CONTENT_AUDIT_REPORT (新) CUT_OFF_V2 (新) ANCHOR_ECOLOGY_LIVING_DIALOG (新) ANCHOR_LOT_NOTICE (新) ANCHOR_BROADCAST (新) ANCHOR_HELPER_DANMU (新) PLAY_TAG (新) RECALL_DANMU_MSG (新) OTHER_SLICE_LOADING_RESULT (新) --- docs/live/message_stream.md | 909 ++++++++++++++++++++++++++++++++++-- 1 file changed, 882 insertions(+), 27 deletions(-) diff --git a/docs/live/message_stream.md b/docs/live/message_stream.md index 9533d83..7d106df 100644 --- a/docs/live/message_stream.md +++ b/docs/live/message_stream.md @@ -6,6 +6,10 @@ *请求方法: GET* +认证方式: Cookie(SESSDATA) + +可以选择进行认证,若未认证视作未登录,将会受到限制,详见后续内容。 + **URL参数:** | 参数名 | 类型 | 内容 | 必要性 | 备注 | @@ -100,7 +104,7 @@ curl -G 'https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo' \ **注: 特别的**, WS 与 WSS 连接地址带有路径 `/sub`, 如 `wss://broadcastlv.chat.bilibili.com:443/sub`. -**再注:** B 站更新了隐私政策, 连接建立 5 分钟左右, 若该连接认证时传入信息来自未登录用户, 会提示 `为保护用户隐私,未注册登陆用户将无法查看他人昵称`, 随后所有发送弹幕的用户 mid 都为 `0`, 用户名部分也使用 `*` 保护, 参见 [#732](https://github.com/SocialSisterYi/bilibili-API-collect/issues/732) +**再注:** B 站更新了隐私政策, 连接建立后, 若该连接认证时传入信息来自未登录用户, 会提示 `为保护用户隐私,未注册登陆用户将无法查看他人昵称`, 随后部分数据包(如“弹幕”、“进场或关注消息”)的用户 mid 都为 `0`, 用户名部分也使用 `*` 保护, 部分房间受到豁免, 参见 [#732](https://github.com/SocialSisterYi/bilibili-API-collect/issues/732) 操作流程 (伪代码): @@ -150,6 +154,8 @@ while (!s.isclosed()) { 注: 连接成功后 5 秒内发送, 否则强制断开连接 +再注: 若`uid`字段填写的是用户mid,则通过`获取信息流认证密钥`接口使用的认证信息所属用户mid必须与`uid`字段相同,并正确传递认证密钥,否则强制断开连接。 + **JSON正文:** 根对象: @@ -370,7 +376,7 @@ while (!s.isclosed()) { | show_player_type | num | 0? | | | user | obj | 用户相关信息 | | -`info[0[[15].extra` 表示的对象: +`info[0][15].extra` 表示的对象: 见下方 JSONC @@ -681,7 +687,7 @@ while (!s.isclosed()) { -#### 连续弹幕消息 (DM_INTERACTION) +#### 交互信息合并 (DM_INTERACTION) 注: 连续多条相同弹幕时触发 @@ -696,14 +702,21 @@ while (!s.isclosed()) { `data` 对象: -| 字段 | 类型 | 内容 | 备注 | -| ------ | ---- | -------- | ---- | -| id | num | 事件 ID | | -| status | num | 状态 | | -| type | num | 事件类型 | | -| data | str | 事件数据 | | +| 字段 | 类型 | 内容 | 备注 | +| -------- | ---- | -------- | ---- | +| id | num | 事件 ID | | +| status | num | 状态 | | +| type | num | 事件类型 | 102:弹幕
103:
104:送礼
105:分享
106:点赞 | +| data | str | 事件数据 | 一个JSON字符串 | +| dmsource | num | | | -`data.data` 对象: +`data.data` 字符串对象: + +内容格式取决于`data.type`的类型,下面将按照`data.data(类型)`进行区分标记。 + +温馨提示: 要记得先解析`data.data`内的JSON字符串,不要直接使用哦。 + +`data.data(102)` 对象: (弹幕) | 字段 | 类型 | 内容 | 备注 | | -------------------- | ----- | -------------------- | ---- | @@ -712,7 +725,7 @@ while (!s.isclosed()) { | card_appear_interval | num | 弹窗出现时间间隔 | | | send_interval | num | 发送时间间隔 | | -`data.data.combo[n]` 对象: +`data.data(102).combo[n]` 对象: | 字段 | 类型 | 内容 | 备注 | | ------------- | ---- | -------------- | ------------- | @@ -724,11 +737,48 @@ while (!s.isclosed()) { | left_duration | num | 左移时长 | | | fade_duration | num | 淡化时长 | | +`data.data(104)` 对象: (送礼) + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| fade\_duration | num | | | +| cnt | num | 投喂计数 | | +| card_appear_interval | num | | | +| suffix\_text | str | 提示文本 | `人在投喂` | +| reset\_cnt | num | | | +| display\_flag | num | | | +| gift\_id | num | 礼物 ID | | +| gift_alert_message | str | | | + +`data.data(105)` 对象: (分享) + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| fade\_duration | num | | | +| cnt | num | 分享计数 | | +| card_appear_interval | num | | | +| suffix\_text | str | 提示文本 | `人分享了直播间` | +| reset\_cnt | num | | | +| display\_flag | num | | | + +`data.data(106)` 对象: (点赞) + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| fade\_duration | num | | | +| cnt | num | 点赞计数 | | +| card_appear_interval | num | | | +| suffix\_text | str | 提示文本 | `人正在点赞` | +| reset\_cnt | num | | | +| display\_flag | num | | | + **示例:**
查看正文示例: +type===102 + ```json { "cmd": "DM_INTERACTION", @@ -756,6 +806,51 @@ while (!s.isclosed()) { } ``` +type===104 + +```json +{ + "cmd": "DM_INTERACTION", + "data": { + "data": "{\"fade_duration\":10000,\"cnt\":5,\"card_appear_interval\":0,\"suffix_text\":\"人在投喂\",\"reset_cnt\":0,\"display_flag\":1,\"gift_id\":33988,\"gift_alert_message\":\"投喂一个%s支持主播\"}", + "dmscore": 36, + "id": 85744481752576, + "status": 5, + "type": 104 + } +} +``` + +type===105 + +```json +{ + "cmd": "DM_INTERACTION", + "data": { + "data": "{\"fade_duration\":10000,\"cnt\":1,\"card_appear_interval\":0,\"suffix_text\":\"人分享了直播间\",\"reset_cnt\":0,\"display_flag\":1}", + "dmscore": 36, + "id": 85743053669888, + "status": 4, + "type": 105 + } +} +``` + +type===106 + +```json +{ + "cmd": "DM_INTERACTION", + "data": { + "data": "{\"fade_duration\":10000,\"cnt\":11,\"card_appear_interval\":0,\"suffix_text\":\"人正在点赞\",\"reset_cnt\":1,\"display_flag\":1}", + "dmscore": 36, + "id": 66159395305984, + "status": 5, + "type": 106 + } +} +``` +
#### 进场或关注消息 (INTERACT_WORD) @@ -780,7 +875,7 @@ while (!s.isclosed()) { | fans_medal | obj | 粉丝勋章 | | | identities | num | 待调查 | | | is_spread | num | 待调查 | | -| msg_type | num | 1为进场,2为关注 | | +| msg_type | num | 1为进场,2为关注,3为分享 | | | roomid | num | 房间号 | | | is_spread | num | 待调查 | | | is_spread | num | 待调查 | | @@ -1245,6 +1340,8 @@ while (!s.isclosed()) { } ``` + + #### 送礼 (SEND_GIFT) **JSON消息:** @@ -1673,7 +1770,7 @@ while (!s.isclosed()) { | ---- | ---- | ------ | --------- | | cmd | str | `NOTICE_MSG` | | | id | num | 待调查 | | -| name | str | 通知名 | | +| name | str | 通知名 | | | full | obj | 完整显示信息? | | | half | obj | 半部显示信息? | | | | side | obj | 边缘显示信息? | | @@ -1803,19 +1900,42 @@ while (!s.isclosed()) { | 字段 | 类型 | 内容 | 备注 | | ---- | ---- | ------ | --------- | | cmd | str | `PREPARING` | | -| round | num | 轮播状态:
1正在轮播
0未轮播 | | -| roomid | num | 直播间ID | 未知是真实ID还是短号 | | +| round | num | 轮播状态:
1正在轮播
0未轮播 | 开启轮播时存在 | +| roomid | str | 直播间ID | 未知是真实ID还是短号 | 类型似乎从num改为str | +| msg\_id | str | 信息id? | | +| p\_is\_ack | bool | | 未知 | +| p\_msg\_type | num | `1` | 未知 | +| send\_time | num | 发送时间 | UNIX 毫秒时间戳 | **示例:**
查看消息示例: - + +有启用轮播: + ```json { "cmd": "PREPARING", + "msg_id": "26964930181741056:1000:1000", + "p_is_ack": true, + "p_msg_type": 1, + "roomid": "1899237171", "round": 1, - "roomid": "8618057" + "send_time": 1739985402716 +} +``` + +未启用轮播: + +```json +{ + "cmd": "PREPARING", + "msg_id": "27040425357932032:1000:1000", + "p_is_ack": true, + "p_msg_type": 1, + "roomid": "1017", + "send_time": 1740129398337 } ``` @@ -1823,6 +1943,8 @@ while (!s.isclosed()) { #### 直播开始 (LIVE) +注:请求了开始直播接口、开始向服务器推流时下发。 + **JSON消息:** 根对象: @@ -1830,19 +1952,19 @@ while (!s.isclosed()) { | 字段 | 类型 | 内容 | 备注 | | --- | --- | --- | --- | | cmd | str | `LIVE` | | -| live_key | str | ? | | +| live_key | str | 标记直播场次的key | 与开始直播接口获得的live_key相同 | | voice_background | str | ? | | | sub_session_key | str | ? | | -| live_platform | str | 开播平台? | | +| live_platform | str | 开播平台? | 推测由开播接口决定 | | live_model | num | ? | | -| live_time | num | 开播时间 | UNIX 秒级时间戳 | +| live_time | num | 开播时间 | UNIX 秒级时间戳,只有请求了开始直播后立刻下发的那个数据包里存在 | | roomid | num | 直播间号 | | **示例:**
查看消息示例: - + ```json { "cmd": "LIVE", @@ -1856,6 +1978,8 @@ while (!s.isclosed()) { } ``` +
+ #### 主播信息更新 (ROOM_REAL_TIME_MESSAGE_UPDATE) **JSON消息:** @@ -2001,6 +2125,45 @@ while (!s.isclosed()) {
+#### 未登录通知 (LOG_IN_NOTICE) + +注:未使用认证信息进行登录将会下发此数据包,通常于认证包回复后下发,在后续时间里也有可能会下发;部分受到豁免的直播间不会下发。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `LOG_IN_NOTICE` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| notice\_msg | str | 通知内容 | | +| image\_web | str | 在网页端使用的通知图片 | | +| image\_app | str | 在app端使用的图片 | (未确认) | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "LOG_IN_NOTICE", + "data": { + "notice_msg": "为保护用户隐私,未登录无法查看他人昵称", + "image_web": "http://i0.hdslb.com/bfs/dm/75e7c16b99208df259fe0a93354fd3440cbab412.png", + "image_app": "http://i0.hdslb.com/bfs/dm/b632f7dcd3acf47deffb5f9ccc9546ae97a3415b.png" + } +} +``` + +
+ #### 用户到达直播间高能榜前三名的消息 (ONLINE_RANK_TOP3) **JSON消息:** @@ -3002,18 +3165,20 @@ while (!s.isclosed()) { | 字段 | 类型 | 内容 | 备注 | | ---------- | --- | ------ | --------- | | title | str | 直播间标题 | | -| area_id | num | 当前直播间所属分区的ID | | -| parent_area_id | num | 待调查 | | -| area_name | str | 当前直播间所属分区的名称 | | -| parent_area_name | str | 待调查 | | -| live_key | str | 待调查 | | -| sub_session_key | str | 待调查 | | +| area_id | num | 当前直播间所属二级分区的ID | | +| parent_area_id | num | 当前直播间所属一级分区的ID | | +| area_name | str | 当前直播间所属二级分区的名称 | | +| parent_area_name | str | 当前直播间所属一级分区名称 | | +| live_key | str | 标记直播场次的key | 未开播更新直播间信息时为`"0"` | +| sub_session_key | str | 待调查 | 未开播更新直播间信息时为`""`(空字符串) | **示例:**
查看消息示例: +已开播: + ```json { "cmd": "ROOM_CHANGE", @@ -3029,6 +3194,68 @@ while (!s.isclosed()) { } ``` +未开播: + +```json +{ + "cmd": "ROOM_CHANGE", + "data": { + "title": "随缘", + "area_id": 216, + "parent_area_id": 6, + "area_name": "我的世界", + "parent_area_name": "单机游戏", + "live_key": "0", + "sub_session_key": "" + } +} +``` + +
+ +#### 直播间内容审核报告 (ROOM_CONTENT_AUDIT_REPORT) + +注:这个数据包需要更新直播间标题且使用主播的登录信息才会下发,更新直播间标题后一般不会立刻下发。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `ROOM_CONTENT_AUDIT_REPORT` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| audit_content_type | num | 审核内容类型? | | +| room\_id | num | 直播间ID | 未知是真实ID还是短号 | +| anchor\_uid | num | 主播的用户mid | | +| audit\_status | num | 审核状态? | | +| audit\_title | str | 被审核的直播间标题 | | +| audit\_reason | str | 审核结果 | | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "ROOM_CONTENT_AUDIT_REPORT", + "data": { + "audit_content_type": 1, + "room_id": 1899237171, + "anchor_uid": 438160221, + "audit_status": 2, + "audit_title": "崩坏学园2", + "audit_reason": "一审通过" + } +} +``` +
#### 醒目留言按钮 (SUPER_CHAT_ENTRANCE) @@ -3379,6 +3606,320 @@ while (!s.isclosed()) { +#### 切断V2 (CUT_OFF_V2) + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `CUT_OFF_V2` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cut_off_scene | num | | | +| timestamp | num | 操作时间戳 | UNIX 秒时间戳 | +| cut_off_version | num | 切断提示信息版本? | | +| cut_off_data | obj | 切断提示信息 | | + +`data.cut_off_data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cut_off_title | str | 对话框窗口标题 | | +| cut\_off\_message\_list | array | 对话框正文列表 | | +| cut\_off\_tip\_list | array | 对话框提示信息列表 | | +| cut\_off\_button\_list | array | 对话框按钮列表 | | + +`data.cut_off_data.cut_off_message_list` 数组: + +| 索引 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| 0 | obj | 首个正文信息 | | +| … | obj | 单个正文信息 | | +| i | obj | 最后正文信息 | | + +`data.cut_off_data.cut_off_message_list[i]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| type | num | 显示类别 | `1`:一个“`label`:`content`”格式的信息 | +| label | str | 标签 | | +| content | str | 内容 | | + +`data.cut_off_data.cut_off_tip_list` 数组: + +| 索引 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| 0 | obj | 首个提示行信息 | | +| … | obj | 单个提示行信息 | | +| i | obj | 最后提示行信息 | | + +`data.cut_off_data.cut_off_tip_list[i]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| show\_platform | array | 要在哪个客户端显示的指代 | | +| message_list | array | 提示信息列表 | | + +`data.cut_off_data.cut_off_tip_list[i].message_list` 数组: + +| 索引 | 类型 | 内容 | 备注 | +|:---:| --- | --- | --- | +| 0 | obj | 首个提示组件信息 | | +| … | obj | 单个提示组件信息 | | +| i1 | obj | 最后提示组件信息 | | + +`data.cut_off_data.cut_off_tip_list[i].message_list[i1]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| type | num | 显示类型 | `1`:纯文本
`2`:链接 | +| content | str | 显示文本 | | +| link_url | str | 链接 | type为2时有内容 | + +`data.cut_off_data.cut_off_button_list` 数组: + +| 索引 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| 0 | obj | 首个按钮信息 | | +| … | obj | 单个按钮信息 | | +| i | obj | 最后按钮信息 | | + +`data.cut_off_data.cut_off_button_list[i]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| show_platform | array | 要在那个客户端显示的指代 | `1`和`2`可能是手机直播姬
`3`和`4`可能是pc直播姬或网页直播姬 | +| button\_text | str | 按钮文本 | | +| button\_action | num | 按钮操作 | `1`:关闭窗口?
`2`:跳转到链接? | +| button_link_url | str | 跳转链接 | | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "CUT_OFF_V2", + "data": { + "cut_off_scene": 1, + "timestamp": 1731590280, + "cut_off_version": 1, + "cut_off_data": { + "cut_off_title": "违规提示", + "cut_off_message_list": [ + { + "type": 1, + "label": "处罚结果", + "content": "切断本场直播" + }, + { + "type": 1, + "label": "违规原因", + "content": "您本场直播存在挂机、录播等消极直播行为,因此直播被切断,请您及时整改" + }, + { + "type": 1, + "label": "处罚时间", + "content": "2024年11月14日21时17分" + } + ], + "cut_off_tip_list": [ + { + "show_platform": [ + 3, + 4 + ], + "message_list": [ + { + "type": 1, + "content": "请在", + "link_url": "" + }, + { + "type": 2, + "content": "【处罚中心】", + "link_url": "https://link.bilibili.com/p/center/index?my-room/violation-records#/my-room/violation-records" + }, + { + "type": 1, + "content": "查看你的违规记录", + "link_url": "" + } + ] + } + ], + "cut_off_button_list": [ + { + "show_platform": [ + 1, + 2 + ], + "button_text": "了解详情", + "button_action": 2, + "button_link_url": "https://live.bilibili.com/p/html/live-anchor-galaxy/violation_records/mobile.html?-Abrowser=live&is_live_webview=1" + }, + { + "show_platform": [ + 3, + 4 + ], + "button_text": "我知道了", + "button_action": 1, + "button_link_url": "" + } + ] + } + } +} +``` + +
+ +#### 直播对话框 (ANCHOR_ECOLOGY_LIVING_DIALOG) + +注:推测在自动检测到画面不怎么变化且没人聊天时警告下发,见[#1139(issue正文)](https://github.com/SocialSisterYi/bilibili-API-collect/issues/1139#issue-2657488653)。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `ANCHOR_ECOLOGY_LIVING_DIALOG` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| dialog\_scene | num | | | +| timestamp | num | 触发时间戳 | UNIX 秒时间戳 | +| valid_timestamp | num | | | +| dialog\_top\_vertical\_img | str | | | +| dialog\_top\_landscape_img | str | | | +| dialog\_title | str | 对话框标题 | | +| dialog_message_list | array | 对话框正文列表 | 参见`CUT_OFF_V2` | +| dialog_tip_list | array | 对话框提示信息列表 | 参见`CUT_OFF_V2` | +| dialog_button_list | array | 对话框按钮列表 | 参见`CUT_OFF_V2` | + +`data.dialog_message_list` 数组: + +同`CUT_OFF_V2`的`data.cut_off_data.cut_off_message_list`数组。 + +`data.dialog_tip_list` 数组: + +同`CUT_OFF_V2`的`data.cut_off_data.cut_off_tip_list`数组。 + +`data.dialog_button_list` 数组: + +同`CUT_OFF_V2`的`data.cut_off_data.cut_off_button_list`数组。 + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "ANCHOR_ECOLOGY_LIVING_DIALOG", + "data": { + "dialog_scene": 1, + "timestamp": 1731504845, + "valid_timestamp": 0, + "dialog_top_vertical_img": "https://i0.hdslb.com/bfs/live/ee359d3e89bb044914f72a557a4ac2d3b5ba4004.png", + "dialog_top_landscape_img": "https://i0.hdslb.com/bfs/live/ee359d3e89bb044914f72a557a4ac2d3b5ba4004.png", + "dialog_title": "直播间违规", + "dialog_message_list": [ + { + "type": 1, + "label": "处罚结果", + "content": "警告" + }, + { + "type": 1, + "label": "违规原因", + "content": "您本场直播存在挂机、录播等消极直播行为,请及时整改" + }, + { + "type": 1, + "label": "处罚时间", + "content": "2024年11月13日21时34分" + } + ], + "dialog_tip_list": [ + { + "show_platform": [ + 1, + 2 + ], + "message_list": [ + { + "type": 1, + "content": "请在", + "link_url": "" + }, + { + "type": 2, + "content": "【处罚中心】", + "link_url": "https://live.bilibili.com/p/html/live-anchor-galaxy/violation_records/mobile.html?is_live_half_webview=1u0026hybrid_rotate_d=1u0026is_cling_player=1u0026hybrid_half_ui=1,3,100p,70p,0,1,30,100;2,2,375,100p,0,1,30,100;3,3,100p,70p,0,1,30,100;4,2,375,100p,0,1,30,100;5,3,100p,70p,0,1,30,100;6,3,100p,70p,0,1,30,100;7,3,100p,70p,0,1,30,100;8,3,100p,70p,0,1,30,100#/" + }, + { + "type": 1, + "content": "查看你的违规记录", + "link_url": "" + } + ] + }, + { + "show_platform": [ + 3, + 4 + ], + "message_list": [ + { + "type": 1, + "content": "请在", + "link_url": "" + }, + { + "type": 2, + "content": "【处罚中心】", + "link_url": "https://link.bilibili.com/#/my-room/violation-records?jump_type=browser&app_common=open" + }, + { + "type": 1, + "content": "查看你的违规记录", + "link_url": "" + } + ] + } + ], + "dialog_button_list": [ + { + "show_platform": [ + 1, + 2, + 3, + 4 + ], + "button_text": "我知道了", + "button_action": 1, + "button_link_url": "" + } + ] + } +} +``` + +
+ #### 直播间背景图片修改 (CHANGE_ROOM_INFO) **JSON消息:** @@ -3798,6 +4339,55 @@ while (!s.isclosed()) { +#### 天选时刻通知 (ANCHOR_LOT_NOTICE) + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `ANCHOR_LOT_NOTICE` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| notice\_type | num | 通知卡片类型? | | +| lottery\_card | obj | 通知卡片内容 | | + +`data.lottery_card` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| show\_time | num | 显示时间? | | +| button\_text | str | 按钮文本? | | +| icon | str | 图标 | | +| title | str | 标题? | | + +**示例:** + +
+查看消息示例: + +```json +{ + "data": { + "notice_type": 1, + "lottery_card": { + "show_time": 30, + "button_text": "去发奖", + "icon": "https://i0.hdslb.com/bfs/live/95970204111233f181fc28622502aaf1a9359b9a.png", + "title": "发天选有助于人气累积" + } + }, + "cmd": "ANCHOR_LOT_NOTICE" +} +``` + +
+ #### 邀请视频连线 (VIDEO_CONNECTION_JOIN_START) **示例:** @@ -3935,3 +4525,268 @@ while (!s.isclosed()) { ``` + +#### 直播小助手? (ANCHOR_BROADCAST) + +第一次达到了某种条件下发。 + +已知当在一个分区(中途不能切换)开播时长达到150、180、200、300分钟可能下发,直播间初次被分享1~2次时下发。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `ANCHOR_BROADCAST` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| sender | str | 标题? | `直播小助手` | +| msg | str | 提示消息 | | +| platform | num | 平台标识? | `0` | +| button\_info | obj | 按钮信息? | | +| milestone\_type | str | 里程碑类型? | `session_livetime`,`first_share`,`session_share` | +| milestone\_value | num | 里程值? | | +| milestone\_index | num | 里程碑类型的索引? | `1`,`5`,`6`,`7` | + +`data.button_info` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| button\_name | str | | | +| blink_button_type | str | | | +| blink_button_target | str | | | +| blink_button_extra | str | | | +| blink_button_label | num | | | +| hime_button_type | str | | | +| hime_button_target | str | | | +| hime_button_extra | str | | | +| hime\_button\_h5\_type | str | | | +| hime_button_label | num | | | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "ANCHOR_BROADCAST", + "data": { + "sender": "直播小助手", + "msg": "恭喜你,开播时长达到180分钟!", + "platform": 0, + "button_info": { + "button_name": "", + "blink_button_type": "", + "blink_button_target": "", + "blink_button_extra": "", + "blink_button_label": 0, + "hime_button_type": "", + "hime_button_target": "", + "hime_button_extra": "", + "hime_button_h5_type": "", + "hime_button_label": 0 + }, + "milestone_type": "session_livetime", + "milestone_value": 10800, + "milestone_index": 6 + } +} +``` + +
+ +#### 直播小助手? (ANCHOR_HELPER_DANMU) + +几乎与`ANCHOR_BROADCAST`一同下发。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `ANCHOR_HELPER_DANMU` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| sender | str | 标题? | `直播小助手` | +| msg | str | 提示消息 | | +| platform | num | 平台标识? | | +| button\_platform | num | | | +| button\_name | str | | | +| button\_target | str | | | +| button\_label | num | | | +| report\_type | str | 上报类型? | | +| report | str | | | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "ANCHOR_HELPER_DANMU", + "data": { + "sender": "直播小助手", + "msg": "恭喜你,开播时长达到150分钟!", + "platform": 3, + "button_platform": 0, + "button_name": "", + "button_target": "", + "button_label": 0, + "report_type": "milestone", + "report": "session_livetime:5:9000" + } +} +``` + +
+ +#### 直播进度条节点标签 (PLAY_TAG) + +注: 在特定直播间的特定情况下发。 + +例如: 在[直播间6](https://live.bilibili.com/6)内,有人打出了某种操作。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `PLAY_TAG` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| tag\_id | num | 标签 ID | | +| pic | str | 标签图标 | 通常显示于进度条之上 | +| timestamp | num | UNIX 秒时间戳 | | +| type | str | 操作类型 | `ADD`:添加 | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "PLAY_TAG", + "data": { + "tag_id": 367751, + "pic": "https://i0.hdslb.com/bfs/live/0e04525fee9ea6ea6973e8bd1116d9f1f6501d37.png", + "timestamp": 1740319807, + "type": "ADD" + } +} +``` + +
+ +#### ??? (RECALL_DANMU_MSG) + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `RECALL_DANMU_MSG` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| recall_type | num | 类型? | `2` | +| target_id | num | | | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "RECALL_DANMU_MSG", + "data": { + "recall_type": 2, + "target_id": 525503743 + } +} +``` + +
+ +#### 直播剪辑 (OTHER_SLICE_LOADING_RESULT) + +注: 点击剪辑按钮后的几秒内下发,目前只有网页端有这个按钮,且部分直播间可用(2025-02-20记录)。 + +**JSON消息:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| cmd | str | `OTHER_SLICE_LOADING_RESULT` | | +| data | obj | 信息本体 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| data | array | 剪辑片段数据 | | +| live_key | str | 标记直播场次的key | 未验证真实性 | + +`data.data` 数组: + +| 索引 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| 0 | obj | 单个片段数据 | | + +`data.data[i]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --- | --- | --- | --- | +| start\_time | num | 片段开始时间时间戳 | UNIX 秒时间戳 | +| end\_time | num | 片段结束时间时间戳 | UNIX 秒时间戳 | +| stream | str | 从开始时间到结束时间内的直播视频片段 | 需要使用浏览器用户代理字符串,特别是m3u文件内的视频链接 | +| type | num | 类型? | | +| ban\_ec | bool | ? | | + +**示例:** + +
+查看消息示例: + +```json +{ + "cmd": "OTHER_SLICE_LOADING_RESULT", + "data": { + "data": [ + { + "start_time": 1740037738, + "end_time": 1740038916, + "stream": "https://jssz-boss.hdslb.com/live2arc_anchor_video/vod_579433011406177273.m3u?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=y4zI4XTQzlOkmSKg%2F20250220%2Fjssz%2Fs3%2Faws4_request&X-Amz-Date=20250220T080858Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=52be315e8e7def8e11f86d3c6d4952362725c3c087a433780926bc0e8c88c2e1", + "type": 0, + "ban_ec": false + } + ], + "live_key": "579433011406177273" + } +} +``` + +
From e7bfe392b7ba170df681186a03cd6424250f7d92 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:24:17 +0800 Subject: [PATCH 08/33] feat(APP_widget/ver.md): getappversion --- docs/APP_widget/ver.md | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/APP_widget/ver.md b/docs/APP_widget/ver.md index 0fdfc47..5618564 100644 --- a/docs/APP_widget/ver.md +++ b/docs/APP_widget/ver.md @@ -180,3 +180,55 @@ curl -G 'https://app.bilibili.com/x/v2/version/fawkes/upgrade' \ ``` + +## 拼接最新版本下载地址 + +> https://api.bilibili.com/x/web-frontend/getappversion + +*请求方法: GET* + +**URL参数:** + +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +| ---- | ---- | ---- | ---- | ---- | +| target | string | 目标平台 | 目测仅 `pc_electron`, 错误的值会导致返回 `HTTP 404` | +| cdn_url | string | CDN URL | 任意字符串, 默认 `https://dl.hdslb.com/mobile/fixed/bili_win/bili_win-install.exe` | + +**JSON回复:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| ---- | ---- | ---- | ---- | +| code | number | 返回值 | 0: 成功
-1: need target | +| message | string | 错误消息 | 成功时无此项 | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| ---- | ---- | ---- | ---- | +| cdn_url | string | CDN URL | 内容同请求参数 `cdn_url` | +| sole_cdn_url | string | 带版本的 CDN URL | `cdn_url + "?v=" + 最新版本` | + +**示例:** + +```shell +curl -G 'https://api.bilibili.com/x/web-frontend/getappversion' \ +--url-query 'target=pc_electron' \ +--url-query 'cdn_url=https://dl.hdslb.com/mobile/fixed/bili_win/bili_win-install.exe' +``` + +
+查看响应示例: + +```json +{ + "code": 0, + "data": { + "cdn_url": "https://dl.hdslb.com/mobile/fixed/bili_win/bili_win-install.exe", + "sole_cdn_url": "https://dl.hdslb.com/mobile/fixed/bili_win/bili_win-install.exe?v=1.16.1-2" + } +} +``` + +
From 9aafd85d0b856c0e0e888cbb169e3debe72abcf2 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 14:26:14 +0800 Subject: [PATCH 09/33] fix(video_ranking/ranking.md): v2 urlparam rid close #1193 --- docs/video_ranking/ranking.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/video_ranking/ranking.md b/docs/video_ranking/ranking.md index 4bdd3ca..f8f994f 100644 --- a/docs/video_ranking/ranking.md +++ b/docs/video_ranking/ranking.md @@ -12,14 +12,19 @@ *请求方式:GET* +鉴权方式: 请求头 `User-Agent` 非敏感字符串 + 获取稿件内容质量,近期的数据前100个稿件,动态更新。 **url参数:** -| 参数名 | 类型 | 内容 | 必要性 | 备注 | -| ------ | ---- | ----------- | ------ | ------------------------------------- | -| tid | num | 目标分区tid | 非必要 | 可参考[视频分区一览](../video/video_zone.md#视频分区一览),只支持主分区 | -| type | str | 未知 | 非必要 | 默认为:all,且为目前唯一已知值。怀疑为稿件类型,但没有找到其他值佐证。 | +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +| ------------ | ------ | ------------ | ------ | ------------------------------------- | +| rid | number | 目标分区 tid | 非必要 | 默认为 0 (全站), 详细参见 [视频分区一览](../video/video_zone.md#视频分区一览), 仅支持主分区 | +| type | string | 排行榜类型 | 非必要 | 全部: all
新人: rokkie
原创: origin | +| web_location | string | 333.934 | 非必要 | | +| w_rid | string | WBI 签名 | 非必要 | 参见 [WBI 签名](../misc/sign/wbi.md) | +| wts | number | Unix 时间戳 | 非必要 | 参见 [WBI 签名](../misc/sign/wbi.md) | **json回复:** From 1e007cc855348d96590131e67e76fe2834d095ee Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 14:36:06 +0800 Subject: [PATCH 10/33] fix(fav/info.md): list-all attr close #1190 --- docs/fav/info.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/fav/info.md b/docs/fav/info.md index 2e8aa30..b44111c 100644 --- a/docs/fav/info.md +++ b/docs/fav/info.md @@ -176,7 +176,7 @@ curl -G 'https://api.bilibili.com/x/v3/fav/folder/info' \ | id | num | 收藏夹mlid(完整id) | 收藏夹原始id+创建者mid尾号2位 | | fid | num | 收藏夹原始id | | | mid | num | 创建者mid | | -| attr | num | 属性位 | | +| attr | num | 收藏夹属性 | 转换成8-bit二进制处理
详细说明见下表 | | title | str | 收藏夹标题 | | | fav_state | num | 目标id是否存在于该收藏夹 | 存在于该收藏夹:1
不存在于该收藏夹:0 | | media_count | num | 收藏夹内容数量 | | @@ -185,8 +185,8 @@ curl -G 'https://api.bilibili.com/x/v3/fav/folder/info' \ | 位 | 内容 | 备注 | | --------------- | ---------------- | -------------------------------- | -| 0 | 是否为默认收藏夹 | 0:默认收藏夹
1:其他收藏夹 | -| 1 | 私有收藏夹 | 0:公开
1:私有 | +| 0 | 私有收藏夹 | 0:公开
1:私有 | +| 1 | 是否为默认收藏夹 | 0:默认收藏夹
1:其他收藏夹 | | 其他有待补充... | | | **示例:** @@ -304,7 +304,7 @@ curl -G 'https://api.bilibili.com/x/v3/fav/folder/created/list-all' \ | id | num | 收藏夹ml | | | fid | num | 原始收藏夹mlid | 去除两位mid尾号 | | mid | num | 创建用户mid | | -| attr | num | 收藏夹属性 | 转换成8-bit二进制处理
详细说明见下表 | +| attr | num | 收藏夹属性 | [同上 attr](#获取指定用户创建的所有收藏夹信息) | | title | str | 收藏夹标题 | | | cover | str | 收藏夹封面图片url | | | upper | obj | 收藏夹创建用户信息 | | @@ -316,12 +316,6 @@ curl -G 'https://api.bilibili.com/x/v3/fav/folder/created/list-all' \ | fav_state | num | 0 | 作用尚不明确 | | media_count | num | 收藏夹总计视频数 | | -`attr`属性二进制值表: - -| 其他有待补充... | 1:默认收藏夹 | 0:公开性 | -| --------------- | -------------------------------- | -------------------- | -| | 0:默认收藏夹
1:其他收藏夹 | 0:公开
1:私有 | - `data`中的`list`数组中的对象中的`upper`对象: | 字段 | 类型 | 内容 | 备注 | From f0b3191d0e7c13d9ac4a9277c5a8aca6fb4686c1 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 14:59:43 +0800 Subject: [PATCH 11/33] feat(fav/info.md): list-all urlparam web_location --- docs/fav/info.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/fav/info.md b/docs/fav/info.md index b44111c..fe02478 100644 --- a/docs/fav/info.md +++ b/docs/fav/info.md @@ -141,6 +141,7 @@ curl -G 'https://api.bilibili.com/x/v3/fav/folder/info' \ | up_mid | num | 目标用户mid | 必要 | | | type | num | 目标内容属性 | 非必要 | 默认为全部
0:全部
2:视频稿件 | | rid | num | 目标内容id | 非必要 | 视频稿件:视频稿件avid | +| web_location | str | 333.1387 | 非必要| | **json回复:** @@ -176,7 +177,7 @@ curl -G 'https://api.bilibili.com/x/v3/fav/folder/info' \ | id | num | 收藏夹mlid(完整id) | 收藏夹原始id+创建者mid尾号2位 | | fid | num | 收藏夹原始id | | | mid | num | 创建者mid | | -| attr | num | 收藏夹属性 | 转换成8-bit二进制处理
详细说明见下表 | +| attr | num | 收藏夹属性 | 二进制位属性
详细说明见下表 | | title | str | 收藏夹标题 | | | fav_state | num | 目标id是否存在于该收藏夹 | 存在于该收藏夹:1
不存在于该收藏夹:0 | | media_count | num | 收藏夹内容数量 | | From 96ed6aae8af70c08daa04d42b8d27841adefa73d Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:10:03 +0800 Subject: [PATCH 12/33] feat(danmaku/danmaku_xml.md): pool 3 close #1109 --- docs/danmaku/danmaku_xml.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/danmaku/danmaku_xml.md b/docs/danmaku/danmaku_xml.md index aacaf61..a5ea9ca 100644 --- a/docs/danmaku/danmaku_xml.md +++ b/docs/danmaku/danmaku_xml.md @@ -110,7 +110,7 @@ curl 'https://comment.bilibili.com/144541892.xml' | 2 | 弹幕字号 | int32 | 18:小
25:标准
36:大 | | 3 | 弹幕颜色 | int32 | 十进制RGB888值 | | 4 | 弹幕发送时间 | int32 | 时间戳 | -| 5 | 弹幕池类型 | int32 | 0:普通池
1:字幕池
2:特殊池(代码/BAS弹幕) | +| 5 | 弹幕池类型 | int32 | 0: 普通池
1: 字幕池
2: 特殊池 (代码/BAS弹幕)
3: 互动池?| | 6 | 发送者mid的HASH | string | 用于屏蔽用户和查看用户发送的所有弹幕 也可反查用户id | | 7 | 弹幕dmid | int64 | 唯一 可用于操作参数 | | 8 | 弹幕的屏蔽等级 | int32 | 0-10,低于用户设定等级的弹幕将被屏蔽
(新增,下方样例未包含) | From 5e81e288579470be9aee6576dafb9ae68f766361 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:45:50 +0800 Subject: [PATCH 13/33] feat(live/recommend.md): getMoreRecList close #1198 --- docs/live/recommend.md | 651 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 651 insertions(+) create mode 100644 docs/live/recommend.md diff --git a/docs/live/recommend.md b/docs/live/recommend.md new file mode 100644 index 0000000..5edf926 --- /dev/null +++ b/docs/live/recommend.md @@ -0,0 +1,651 @@ +# 直播推荐 + +## 主页获取直播推荐 + +> https://api.live.bilibili.com/xlive/web-interface/v1/webMain/getMoreRecList + +*请求方法: GET* + +**URL 参数:** + +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +| ------------ | ------ | ---------- | ------ | ---- | +| platform | string | 平台类型 | 必要 | 默认为 `web`, 实测可为任意非空串 | +| web_location | string | `333.1007` | 非必要 | | + +**示例:** + +```shell +curl -G 'https://api.live.bilibili.com/xlive/web-interface/v1/webMain/getMoreRecList' \ +--url-query 'platform=web' +``` + +
+查看响应示例: + +```json +{ + "code": 0, + "message": "0", + "ttl": 1, + "data": { + "recommend_room_list": [ + { + "head_box": null, + "area_v2_id": 237, + "area_v2_parent_id": 6, + "area_v2_name": "怀旧游戏", + "area_v2_parent_name": "单机游戏", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/34aedc9409c0abaf622fdb9c6137896b8a9f95d0.jpg", + "link": "/923833?hotRank=0", + "online": 262700, + "pendant_Info": {}, + "roomid": 923833, + "title": "融合版斗蛐蛐s3.5赛季!", + "uname": "沉默寡言白河愁", + "face": "https://i0.hdslb.com/bfs/face/14169798ca31108e4441e790c14b24706def67a3.jpg", + "verify": { + "role": 1, + "desc": "bilibili 知名游戏UP主、直播高能主播", + "type": 0 + }, + "uid": 34646754, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe02071535000000923833okbn8y.jpg", + "is_auto_play": 1, + "head_box_type": 0, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_9A44BEBD-CAEB-46AD-8FD7-B91BA8471EAA", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_9A44BEBD-CAEB-46AD-8FD7-B91BA8471EAA&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=923833&parent_id=6&area_id=237&page=0&position=1&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_9A44BEBD-CAEB-46AD-8FD7-B91BA8471EAA&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=923833&parent_id=6&area_id=237&page=0&position=1&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 30460, + "text_small": "3.0万", + "text_large": "3.0万人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": { + "name": "大乱斗乱斗之王", + "value": "https://i0.hdslb.com/bfs/live/fc28a2a4123154012e0ce3da1273de5f17e81b24.png", + "desc": "" + }, + "area_v2_id": 817, + "area_v2_parent_id": 5, + "area_v2_name": "男声电台", + "area_v2_parent_name": "电台", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/b15e3a1045321a7ffa7da08a47a276ca37557ef1.jpg", + "link": "/32190922?hotRank=0", + "online": 45487, + "pendant_Info": { + "2": { + "type": "mobile_index_badge", + "name": "福佑嘉年", + "position": 2, + "text": "省级亚军", + "bg_color": "#FB9E60", + "bg_pic": "http://i0.hdslb.com/bfs/live/13819a59895263cb25cc2ead3fecfaa3e864aac8.png", + "pendant_id": 1750, + "priority": 200, + "created_at": 1738512313 + } + }, + "roomid": 32190922, + "title": "我想我们会幸福美满", + "uname": "黑羊Klein", + "face": "https://i2.hdslb.com/bfs/face/307c62a8b30a6dcfc02e9670e5dc10d0ecec6921.jpg", + "verify": { + "role": 0, + "desc": "", + "type": -1 + }, + "uid": 1989648419, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe02071536000032190922ma6cnx.jpg", + "is_auto_play": 0, + "head_box_type": 1, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_178A3B8F-86C1-4831-9DBB-9788C2445752", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_178A3B8F-86C1-4831-9DBB-9788C2445752&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=32190922&parent_id=5&area_id=817&page=0&position=2&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_178A3B8F-86C1-4831-9DBB-9788C2445752&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=32190922&parent_id=5&area_id=817&page=0&position=2&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 491, + "text_small": "491", + "text_large": "491人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": null, + "area_v2_id": 654, + "area_v2_parent_id": 2, + "area_v2_name": "诛仙世界", + "area_v2_parent_name": "网游", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/fdad2cfb408510df56a01af66254f630ee4b86b8.jpg", + "link": "/25959685?hotRank=0", + "online": 2151, + "pendant_Info": {}, + "roomid": 25959685, + "title": "免费接所有职业,死灵渊!只要收益", + "uname": "哦-是大一啊", + "face": "https://i1.hdslb.com/bfs/face/f83290ab5667f9c1ed778fb9c7c9cf6bf7624d4e.jpg", + "verify": { + "role": 0, + "desc": "", + "type": -1 + }, + "uid": 361517464, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe02071535000025959685tx1grb.jpg", + "is_auto_play": 1, + "head_box_type": 0, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_FB0DABE2-6A09-4EB7-8D2B-A4F892243A96", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_FB0DABE2-6A09-4EB7-8D2B-A4F892243A96&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=25959685&parent_id=2&area_id=654&page=0&position=3&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_FB0DABE2-6A09-4EB7-8D2B-A4F892243A96&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=25959685&parent_id=2&area_id=654&page=0&position=3&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 269, + "text_small": "269", + "text_large": "269人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": { + "name": "钻石传说", + "value": "https://i0.hdslb.com/bfs/live/2007dc239982e909a3c9971c27968e5c0a872917.png", + "desc": "" + }, + "area_v2_id": 192, + "area_v2_parent_id": 5, + "area_v2_name": "聊天电台", + "area_v2_parent_name": "电台", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/22f1fcac8d9764901005ae5867a8c6b589b93ac5.jpg", + "link": "/31169918?hotRank=0", + "online": 27764, + "pendant_Info": {}, + "roomid": 31169918, + "title": "东北最后的温柔", + "uname": "关关-苏苏冠", + "face": "https://i2.hdslb.com/bfs/face/14f5102417107a6535c11ec9ad99050f7d712a17.jpg", + "verify": { + "role": 0, + "desc": "", + "type": -1 + }, + "uid": 3537120278874479, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe02071532000031169918qep44l.jpg", + "is_auto_play": 0, + "head_box_type": 1, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_3E272538-AA76-4953-BF21-5BB19ECFEE28", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_3E272538-AA76-4953-BF21-5BB19ECFEE28&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=31169918&parent_id=5&area_id=192&page=0&position=4&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_3E272538-AA76-4953-BF21-5BB19ECFEE28&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=31169918&parent_id=5&area_id=192&page=0&position=4&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 297, + "text_small": "297", + "text_large": "297人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": null, + "area_v2_id": 82, + "area_v2_parent_id": 2, + "area_v2_name": "剑网3", + "area_v2_parent_name": "网游", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/user_cover/9551fbb571b35bac3702c47e955177f17cab5cd2.jpg", + "link": "/2849730?hotRank=0", + "online": 4008, + "pendant_Info": {}, + "roomid": 2849730, + "title": "午间陪伴花间刷币", + "uname": "o诡墨o", + "face": "https://i1.hdslb.com/bfs/face/43ab308f836eb352aa4d541b55aafab2fa4435aa.jpg", + "verify": { + "role": 0, + "desc": "", + "type": -1 + }, + "uid": 71574442, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe02071535000002849730qo0792.jpg", + "is_auto_play": 1, + "head_box_type": 0, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_4BAFD91A-DDED-4655-BE47-064A6152BF9B", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_4BAFD91A-DDED-4655-BE47-064A6152BF9B&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=2849730&parent_id=2&area_id=82&page=0&position=5&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_4BAFD91A-DDED-4655-BE47-064A6152BF9B&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=2849730&parent_id=2&area_id=82&page=0&position=5&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 204, + "text_small": "204", + "text_large": "204人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": { + "name": "迷梦幻境头像框", + "value": "https://i0.hdslb.com/bfs/garb/open/d272c8cdb2ab737f5aa3c1cf5a27db274e0ce034.png", + "desc": "" + }, + "area_v2_id": 744, + "area_v2_parent_id": 9, + "area_v2_name": "虚拟Singer", + "area_v2_parent_name": "虚拟主播", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/6e68e5c4f3d720e6f14952174be848383b879dad.jpg", + "link": "/21603945?hotRank=0", + "online": 10606, + "pendant_Info": {}, + "roomid": 21603945, + "title": "听歌碎碎念!~", + "uname": "Minicatty", + "face": "https://i0.hdslb.com/bfs/face/812d9ea6f3420d5c58ff455408275563f03fb861.jpg", + "verify": { + "role": 7, + "desc": "bilibili 直播高能主播", + "type": 0 + }, + "uid": 423902976, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe02071535000021603945pekr70.jpg", + "is_auto_play": 0, + "head_box_type": 2, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_56778C3F-4B14-4C78-8DF8-53721196E8D8", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_56778C3F-4B14-4C78-8DF8-53721196E8D8&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=21603945&parent_id=9&area_id=744&page=0&position=6&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_56778C3F-4B14-4C78-8DF8-53721196E8D8&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=21603945&parent_id=9&area_id=744&page=0&position=6&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 235, + "text_small": "235", + "text_large": "235人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": null, + "area_v2_id": 80, + "area_v2_parent_id": 2, + "area_v2_name": "吃鸡行动", + "area_v2_parent_name": "网游", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/fa7292a8741a40a612a1c466da58b7f9cc08f363.jpg", + "link": "/22976905?hotRank=0", + "online": 8536, + "pendant_Info": {}, + "roomid": 22976905, + "title": "全是细节!", + "uname": "菠萝鸽", + "face": "https://i1.hdslb.com/bfs/face/f073d24cbb992b4589825896de3fb9bc559ba180.jpg", + "verify": { + "role": 1, + "desc": "bilibili 知名游戏UP主、直播高能主播", + "type": 0 + }, + "uid": 1849164526, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe020715350000229769056wy0mu.jpg", + "is_auto_play": 1, + "head_box_type": 0, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_CE3B32EC-E84D-4545-A693-97882454E0ED", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_CE3B32EC-E84D-4545-A693-97882454E0ED&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=22976905&parent_id=2&area_id=80&page=0&position=7&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_CE3B32EC-E84D-4545-A693-97882454E0ED&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=22976905&parent_id=2&area_id=80&page=0&position=7&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 919, + "text_small": "919", + "text_large": "919人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": null, + "area_v2_id": 646, + "area_v2_parent_id": 10, + "area_v2_name": "生活杂谈", + "area_v2_parent_name": "生活", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/833e4d5449bcb4e425eb6399e0ef71f06903d083.jpg", + "link": "/21291747?hotRank=0", + "online": 38125, + "pendant_Info": {}, + "roomid": 21291747, + "title": "哪吒抢了封神票房?", + "uname": "陈哥惜命天涯", + "face": "https://i1.hdslb.com/bfs/face/d2c7e9c9b918ec969b2e15a5f2194bae3acd966e.jpg", + "verify": { + "role": 0, + "desc": "", + "type": -1 + }, + "uid": 286563388, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe0207153000002129174742tpke.jpg", + "is_auto_play": 0, + "head_box_type": 0, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_63BEC7F6-172E-46FC-BBAD-8CD3547AE6C1", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_63BEC7F6-172E-46FC-BBAD-8CD3547AE6C1&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=21291747&parent_id=10&area_id=646&page=0&position=8&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_63BEC7F6-172E-46FC-BBAD-8CD3547AE6C1&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=21291747&parent_id=10&area_id=646&page=0&position=8&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 3107, + "text_small": "3107", + "text_large": "3107人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": { + "name": "Lirin兔耳娘 收藏集", + "value": "https://i2.hdslb.com/bfs/garb/open/41e2a2e3693f49e0b721c443fd784aa533456c49.png", + "desc": "" + }, + "area_v2_id": 745, + "area_v2_parent_id": 9, + "area_v2_name": "虚拟Gamer", + "area_v2_parent_name": "虚拟主播", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/b444bc87fbe1b346184f061efaffff21b24371f1.jpg", + "link": "/23797026?hotRank=0", + "online": 13294, + "pendant_Info": {}, + "roomid": 23797026, + "title": "日v 萌新玩玩三角洲♡", + "uname": "樱咲奈央_Official", + "face": "https://i2.hdslb.com/bfs/face/163330968a4a5fc8f31e9da9e919bbc258ecf40c.jpg", + "verify": { + "role": 7, + "desc": "bilibili直播高能主播", + "type": 0 + }, + "uid": 1880188304, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe020715310000237970260gnmn1.jpg", + "is_auto_play": 0, + "head_box_type": 2, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_691E1F11-4960-4707-92EF-0F0D996E434C", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_691E1F11-4960-4707-92EF-0F0D996E434C&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=23797026&parent_id=9&area_id=745&page=0&position=9&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_691E1F11-4960-4707-92EF-0F0D996E434C&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=23797026&parent_id=9&area_id=745&page=0&position=9&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 999, + "text_small": "999", + "text_large": "999人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": null, + "area_v2_id": 624, + "area_v2_parent_id": 10, + "area_v2_name": "电子榨菜", + "area_v2_parent_name": "生活", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/user_cover/a8a7681eaf20e43e16444e502106a436eb0e454c.jpg", + "link": "/1831473323?hotRank=0", + "online": 6510, + "pendant_Info": {}, + "roomid": 1831473323, + "title": "粤语片-法证1", + "uname": "曦曦每天都开心呀", + "face": "https://i1.hdslb.com/bfs/face/aa2112252080ec2298ea51b129c842fea7ed58f5.jpg", + "verify": { + "role": 0, + "desc": "", + "type": -1 + }, + "uid": 1434707683, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe020715350018314733230k1dhu.jpg", + "is_auto_play": 0, + "head_box_type": 0, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_947BC1A4-E0F4-4ECE-AE40-9D9817848F9A", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_947BC1A4-E0F4-4ECE-AE40-9D9817848F9A&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=1831473323&parent_id=10&area_id=624&page=0&position=10&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_947BC1A4-E0F4-4ECE-AE40-9D9817848F9A&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=1831473323&parent_id=10&area_id=624&page=0&position=10&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 1446, + "text_small": "1446", + "text_large": "1446人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": { + "name": "帕里", + "value": "https://i0.hdslb.com/bfs/garb/item/7c9cd30bfab66e9490d8a03fc48754cdb12b4901.png", + "desc": "" + }, + "area_v2_id": 745, + "area_v2_parent_id": 9, + "area_v2_name": "虚拟Gamer", + "area_v2_parent_name": "虚拟主播", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/bd898138564a7e892e05dd1ff9cf9c34bdd9cb5b.jpg", + "link": "/42512?hotRank=0", + "online": 11612, + "pendant_Info": {}, + "roomid": 42512, + "title": "【文明7】使臣,你去死一下,然后我发兵", + "uname": "优礼子Ghaast", + "face": "https://i0.hdslb.com/bfs/face/e3f05d5b7bf56c57f55026676da71cc487d93988.jpg", + "verify": { + "role": 7, + "desc": "bilibili直播高能主播", + "type": 0 + }, + "uid": 6141432, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe020715350000000425126wxphk.jpg", + "is_auto_play": 0, + "head_box_type": 2, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_0517EBF3-EE5C-4967-A77A-9DB3F89A58A8", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_0517EBF3-EE5C-4967-A77A-9DB3F89A58A8&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=42512&parent_id=9&area_id=745&page=0&position=11&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_0517EBF3-EE5C-4967-A77A-9DB3F89A58A8&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=42512&parent_id=9&area_id=745&page=0&position=11&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 1998, + "text_small": "1998", + "text_large": "1998人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + }, + { + "head_box": { + "name": "百人舰队主播头像", + "value": "https://i0.hdslb.com/bfs/vc/071eb10548fe9bc482ff69331983d94192ce9507.png", + "desc": "" + }, + "area_v2_id": 102, + "area_v2_parent_id": 2, + "area_v2_name": "最终幻想14", + "area_v2_parent_name": "网游", + "broadcast_type": 0, + "cover": "https://i0.hdslb.com/bfs/live/new_room_cover/9370e1bbda854c8ac3b9a2a9a6e960106f307580.jpg", + "link": "/1897222?hotRank=0", + "online": 80052, + "pendant_Info": { + "1": { + "type": "mobile_index_badge", + "name": "百人成就", + "position": 1, + "text": "", + "bg_color": "#FB9E60", + "bg_pic": "https://i0.hdslb.com/bfs/live/539ce26c45cd4019f55b64cfbcedc3c01820e539.png", + "pendant_id": 426, + "priority": 1, + "created_at": 1738857680 + } + }, + "roomid": 1897222, + "title": "鸟区pvp", + "uname": "猫姐姐nya", + "face": "https://i1.hdslb.com/bfs/face/acc5559db9494af780b05fbf05c158995c48d023.jpg", + "verify": { + "role": 1, + "desc": "bilibili 知名游戏UP主", + "type": 0 + }, + "uid": 41377819, + "keyframe": "https://i0.hdslb.com/bfs/live-key-frame/keyframe020715360000018972225sqtbh.jpg", + "is_auto_play": 1, + "head_box_type": 1, + "flag": 0, + "session_id": "4b58e9bf85ef0539525f1c7b1467a5b8_93F5FBE6-4F84-40C9-AEA1-149E9D5D366E", + "group_id": 1000217, + "show_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_93F5FBE6-4F84-40C9-AEA1-149E9D5D366E&group_id=1000217&biz=live&event_id=live_card_show&rule_key=&special_id=0&roomid=1897222&parent_id=2&area_id=102&page=0&position=12&platform=web", + "click_callback": "https://live-trace.bilibili.com/xlive/data-interface/v1/index/log?sessionID=4b58e9bf85ef0539525f1c7b1467a5b8_93F5FBE6-4F84-40C9-AEA1-149E9D5D366E&group_id=1000217&biz=live&event_id=live_card_click&rule_key=&special_id=0&roomid=1897222&parent_id=2&area_id=102&page=0&position=12&platform=web", + "special_id": 0, + "watched_show": { + "switch": true, + "num": 2930, + "text_small": "2930", + "text_large": "2930人看过", + "icon": "https://i0.hdslb.com/bfs/live/a725a9e61242ef44d764ac911691a7ce07f36c1d.png", + "icon_location": 0, + "icon_web": "https://i0.hdslb.com/bfs/live/8d9d0f33ef8bf6f308742752d13dd0df731df19c.png" + }, + "is_nft": 0, + "nft_dmark": "", + "is_ad": false, + "ad_transparent_content": null, + "show_ad_icon": false, + "status": false, + "followers": 0 + } + ], + "top_room_id": 0 + } +} +``` + +
From c5f86789103bb308326683b3da56256b99a55b6a Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:59:34 +0800 Subject: [PATCH 14/33] chore: ignore .swp file & add missing comment --- .gitignore | 2 +- docs/APP_widget/ver.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f8c09a0..d55cc68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -mkdocs/html/ /.vuepress/.cache/ /.vuepress/.temp/ /.vuepress/dist/ @@ -6,3 +5,4 @@ mkdocs/html/ .idea/ .vscode/ .DS_Store +*.swp diff --git a/docs/APP_widget/ver.md b/docs/APP_widget/ver.md index 5618564..3296c87 100644 --- a/docs/APP_widget/ver.md +++ b/docs/APP_widget/ver.md @@ -20,6 +20,8 @@ **JSON回复:** +根对象: + | 字段 | 类型 | 内容 | 备注 | | --- | --- | --- | --- | | code | int | 返回值 | 0: 成功 | From bc7efd30722642dd69864c24776caf2e350ab3e4 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sat, 8 Feb 2025 00:48:49 +0800 Subject: [PATCH 15/33] fix(live/recommend.md): missing response and entrance --- README.md | 1 + docs/live/recommend.md | 66 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/README.md b/README.md index 2e91ec7..d9f93c5 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,7 @@ B站 API 采用 C/S 结构,大多数接口为 REST API 和 gRPC,少部分接 - [x] [播放 & 下载地址(视频流)](docs/cheese/videostream_url.md) - [ ] [直播](docs/live) - [ ] [直播间基本信息](docs/live/info.md) + - [ ] [直播推荐](docs/live/recommend.md) - [ ] [直播分区](docs/live/live_area.md) - [ ] [直播间管理](docs/live/manage.md) - [ ] 直播间操作 diff --git a/docs/live/recommend.md b/docs/live/recommend.md index 5edf926..edbf016 100644 --- a/docs/live/recommend.md +++ b/docs/live/recommend.md @@ -13,6 +13,72 @@ | platform | string | 平台类型 | 必要 | 默认为 `web`, 实测可为任意非空串 | | web_location | string | `333.1007` | 非必要 | | +**JSON 回复:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------- | ------ | -------- | ---- | +| code | number | 返回值 | 0: 成功 | +| message | string | 错误信息 | 默认为 `0` | +| ttl | number | 1 | | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------------------- | ------ | ------------- | -------- | +| recommend_room_list | Array | 推荐房间列表 | 套了个娃 | +| top_room_id | number | 置顶直播间号? | | + +`data` 对象中 `recommend_room_list` 数组中的对象: + +| 字段 | 类型 | 内容 | 备注 | +| ---------------------- | -------------- | ---------------- | ---- | +| head_box | object \| null | 头像框 | 无则为 `null` | +| area_v2_id | number | 分区 ID | | +| area_v2_parent_id | number | 父分区 ID | | +| area_v2_name | string | 分区名称 | | +| area_v2_parent_name | string | 父分区名称 | | +| broadcast_type | number | 广播类型? | | +| cover | string | 封面 URL | | +| link | string | 直播间链接 | 仅 `pathname` 与 `query` 部分 | +| online | number | 观看人数 | | +| pendant_Info | object | ??? | 作用尚不明确 | +| roomid | number | 直播间 ID | | +| title | string | 直播间标题 | | +| uname | string | 主播用户名 | | +| face | string | 主播头像 URL | | +| verify | object | 认证信息 | 参见 [用户基本信息](../user/info.md) | +| uid | number | 主播用户 mid | | +| keyframe | string | 关键帧 URL | | +| is_auto_play | number | 是否自动播放? | | +| head_box_type | number | 头像框类型? | | +| flag | number | 标记? | 作用尚不明确 | +| session_id | string | 会话 ID? | 格式为: 本次请求相同的小写无分隔 UUID + 下划线 + 大写以连字符分隔的 UUID | +| show_callback | string | 展示回调 URL? | | +| click_callback | string | 点击回调 URL? | | +| special_id | number | 特殊 ID? | 作用尚不明确 | +| watched_show | object | 观看展示 | 见下 | +| is_nft | number | 是否为 NFT 头像? | | +| nft_dmark | string | ??? | 作用尚不明确 | +| is_ad | boolean | 是否为广告 | | +| ad_transparent_content | unknown | ??? | 作用尚不明确 | +| show_ad_icon | boolean | 显示广告图标 | | +| status | boolean | 状态? | 作用尚不明确 | +| followers | number | 0 | 作用尚不明确 | + +`recommend_room_list` 数组中的对象中的 `watched_show` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------------- | ------- | -------- | ---- | +| switch | boolean | ??? | 作用尚不明确 | +| num | number | 看过人数 | | +| text_small | string | 小文本 | xxx | +| text_large | string | 大文本 | xxx人看过 | +| icon | string | 图标 URL | 浅色线条眼睛图标 | +| icon_location | number | 0 | | +| icon_web | string | 图标 URL | 深色线条眼睛图标 (Web 端) | + **示例:** ```shell From 14670917f7ba9da5304b218927f5c526b154644f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=8F=AA=E5=B0=8F=E5=8C=85=E5=AD=90?= <1601302408@qq.com> Date: Fri, 21 Mar 2025 17:07:45 +0800 Subject: [PATCH 16/33] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85=E8=8E=B7?= =?UTF-8?q?=E5=8F=96AI=E6=80=BB=E7=BB=93=E5=86=85=E5=AE=B9API=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=9A=84Cookie=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/video/summary.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/video/summary.md b/docs/video/summary.md index b75e6e3..e7da86f 100644 --- a/docs/video/summary.md +++ b/docs/video/summary.md @@ -8,6 +8,8 @@ *请求方式: GET* +认证方式:Cookie(SESSDATA) + 鉴权方式:[Wbi 签名](../misc/sign/wbi.md) **url参数:** @@ -27,7 +29,7 @@ | 字段 | 类型 | 内容 | 备注 | |---------|-----|------|--------------------------| -| code | num | 返回值 | 0: 成功
-400:请求错误
-403: 访问权限不足 | +| code | num | 返回值 | 0: 成功
-101: 账号未登录
-400:请求错误
-403: 访问权限不足 | | message | str | 错误信息 | 默认为0 | | ttl | num | 1 | | | data | obj | 数据本体 | | From 724e618babe94dcc1ddd557ae33fa3f9f176cf12 Mon Sep 17 00:00:00 2001 From: Miuzarte <982809597@qq.com> Date: Fri, 4 Apr 2025 21:26:25 +0800 Subject: [PATCH 17/33] =?UTF-8?q?=E9=87=8D=E6=9E=84=20wbi=20golang=20?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/misc/sign/wbi.md | 307 +++++++++++++++++++++--------------------- 1 file changed, 157 insertions(+), 150 deletions(-) diff --git a/docs/misc/sign/wbi.md b/docs/misc/sign/wbi.md index dacbb28..e86cc8a 100644 --- a/docs/misc/sign/wbi.md +++ b/docs/misc/sign/wbi.md @@ -380,178 +380,185 @@ bar=514&baz=1919810&foo=114&wts=1684805578&w_rid=bb97e15f28edf445a0e4420d36f0157 ### Golang -需要 `github.com/tidwall/gjson` 作为依赖 +无第三方库 ```go package main import ( - "crypto/md5" - "encoding/hex" - "fmt" - "io" - "net/http" - "net/url" - "sort" - "strconv" - "strings" - "sync" - "time" - - "github.com/tidwall/gjson" -) - -var ( - mixinKeyEncTab = []int{ - 46, 47, 18, 2, 53, 8, 23, 32, 15, 50, 10, 31, 58, 3, 45, 35, 27, 43, 5, 49, - 33, 9, 42, 19, 29, 28, 14, 39, 12, 38, 41, 13, 37, 48, 7, 16, 24, 55, 40, - 61, 26, 17, 0, 1, 60, 51, 30, 4, 22, 25, 54, 21, 56, 59, 6, 63, 57, 62, 11, - 36, 20, 34, 44, 52, - } - cache sync.Map - lastUpdateTime time.Time + "bytes" + "crypto/md5" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + "time" ) func main() { - urlStr := "https://api.bilibili.com/x/space/wbi/acc/info?mid=1850091" - newUrlStr, err := signAndGenerateURL(urlStr) - if err != nil { - fmt.Printf("Error: %s", err) - return - } - req, err := http.NewRequest("GET", newUrlStr, nil) - if err != nil { - fmt.Printf("Error: %s", err) - return - } - req.Header.Set("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") - req.Header.Set("Referer", "https://www.bilibili.com/") - response, err := http.DefaultClient.Do(req) - if err != nil { - fmt.Printf("Request failed: %s", err) - return - } - defer response.Body.Close() - body, err := io.ReadAll(response.Body) - if err != nil { - fmt.Printf("Failed to read response: %s", err) - return - } - fmt.Println(string(body)) + u, err := url.Parse("https://api.bilibili.com/x/space/wbi/acc/info?mid=1850091") + if err != nil { + panic(err) + } + fmt.Printf("orig: %s\n", u.String()) + err = Sign(u) + if err != nil { + panic(err) + } + fmt.Printf("signed: %s\n", u.String()) + + // 获取 wbi 时未修改 header + // 但实际使用签名后的 url 时发现风控较为严重 } -func signAndGenerateURL(urlStr string) (string, error) { - urlObj, err := url.Parse(urlStr) - if err != nil { - return "", err - } - imgKey, subKey := getWbiKeysCached() - query := urlObj.Query() - params := map[string]string{} - for k, v := range query { - params[k] = v[0] - } - newParams := encWbi(params, imgKey, subKey) - for k, v := range newParams { - query.Set(k, v) - } - urlObj.RawQuery = query.Encode() - newUrlStr := urlObj.String() - return newUrlStr, nil +// Sign 为链接签名 +func Sign(u *url.URL) error { + return wbiKeys.Sign(u) } -func encWbi(params map[string]string, imgKey, subKey string) map[string]string { - mixinKey := getMixinKey(imgKey + subKey) - currTime := strconv.FormatInt(time.Now().Unix(), 10) - params["wts"] = currTime - - // Sort keys - keys := make([]string, 0, len(params)) - for k := range params { - keys = append(keys, k) - } - sort.Strings(keys) - - // Remove unwanted characters - for k, v := range params { - v = sanitizeString(v) - params[k] = v - } - - // Build URL parameters - query := url.Values{} - for _, k := range keys { - query.Set(k, params[k]) - } - queryStr := query.Encode() - - // Calculate w_rid - hash := md5.Sum([]byte(queryStr + mixinKey)) - params["w_rid"] = hex.EncodeToString(hash[:]) - return params +// Update 无视过期时间更新 +func Update() error { + return wbiKeys.Update() } -func getMixinKey(orig string) string { - var str strings.Builder - for _, v := range mixinKeyEncTab { - if v < len(orig) { - str.WriteByte(orig[v]) - } - } - return str.String()[:32] +func Get() (wk WbiKeys, err error) { + if err = wk.update(false); err != nil { + return WbiKeys{}, err + } + return wbiKeys, nil } -func sanitizeString(s string) string { - unwantedChars := []string{"!", "'", "(", ")", "*"} - for _, char := range unwantedChars { - s = strings.ReplaceAll(s, char, "") - } - return s +var wbiKeys WbiKeys + +type WbiKeys struct { + Img string + Sub string + Mixin string + lastUpdateTime time.Time } -func updateCache() { - if time.Since(lastUpdateTime).Minutes() < 10 { - return - } - imgKey, subKey := getWbiKeys() - cache.Store("imgKey", imgKey) - cache.Store("subKey", subKey) - lastUpdateTime = time.Now() +// Sign 为链接签名 +func (wk *WbiKeys) Sign(u *url.URL) (err error) { + if err = wk.update(false); err != nil { + return err + } + + values := u.Query() + + values = removeUnwantedChars(values, '!', '\'', '(', ')', '*') // 必要性存疑? + + values.Set("wts", strconv.FormatInt(time.Now().Unix(), 10)) + + // [url.Values.Encode] 内会对参数排序, + // 且遍历 map 时本身就是无序的 + hash := md5.Sum([]byte(values.Encode() + wk.Mixin)) // Calculate w_rid + values.Set("w_rid", hex.EncodeToString(hash[:])) + u.RawQuery = values.Encode() + return nil } -func getWbiKeysCached() (string, string) { - updateCache() - imgKeyI, _ := cache.Load("imgKey") - subKeyI, _ := cache.Load("subKey") - return imgKeyI.(string), subKeyI.(string) +// Update 无视过期时间更新 +func (wk *WbiKeys) Update() (err error) { + return wk.update(true) } -func getWbiKeys() (string, string) { - client := &http.Client{} - req, err := http.NewRequest("GET", "https://api.bilibili.com/x/web-interface/nav", nil) - if err != nil { - fmt.Printf("Error creating request: %s", err) - return "", "" - } - req.Header.Set("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") - req.Header.Set("Referer", "https://www.bilibili.com/") - resp, err := client.Do(req) - if err != nil { - fmt.Printf("Error sending request: %s", err) - return "", "" - } - defer resp.Body.Close() - body, err := io.ReadAll(resp.Body) - if err != nil { - fmt.Printf("Error reading response: %s", err) - return "", "" - } - json := string(body) - imgURL := gjson.Get(json, "data.wbi_img.img_url").String() - subURL := gjson.Get(json, "data.wbi_img.sub_url").String() - imgKey := strings.Split(strings.Split(imgURL, "/")[len(strings.Split(imgURL, "/"))-1], ".")[0] - subKey := strings.Split(strings.Split(subURL, "/")[len(strings.Split(subURL, "/"))-1], ".")[0] - return imgKey, subKey +// update 按需更新 +func (wk *WbiKeys) update(purge bool) error { + if !purge && time.Since(wk.lastUpdateTime) < time.Hour { + return nil + } + + // 测试下来不用修改 header 也能过 + resp, err := http.Get("https://api.bilibili.com/x/web-interface/nav") + if err != nil { + return err + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + + nav := Nav{} + err = json.Unmarshal(body, &nav) + if err != nil { + return err + } + + if nav.Code != 0 && nav.Code != -101 { // -101 未登录时也会返回两个 key + return fmt.Errorf("unexpected code: %d, message: %s", nav.Code, nav.Message) + } + img := nav.Data.WbiImg.ImgUrl + sub := nav.Data.WbiImg.SubUrl + if img == "" || sub == "" { + return fmt.Errorf("empty image or sub url: %s", body) + } + + // https://i0.hdslb.com/bfs/wbi/7cd084941338484aae1ad9425b84077c.png + imgParts := strings.Split(img, "/") + subParts := strings.Split(sub, "/") + + // 7cd084941338484aae1ad9425b84077c.png + imgPng := imgParts[len(imgParts)-1] + subPng := subParts[len(subParts)-1] + + // 7cd084941338484aae1ad9425b84077c + wbiKeys.Img = strings.TrimSuffix(imgPng, ".png") + wbiKeys.Sub = strings.TrimSuffix(subPng, ".png") + + wbiKeys.mixin() + wbiKeys.lastUpdateTime = time.Now() + return nil +} + +func (wk *WbiKeys) mixin() { + var mixin [32]byte + wbi := wk.Img + wk.Sub + for i := range mixin { // for i := 0; i < len(mixin); i++ { + mixin[i] = wbi[mixinKeyEncTab[i]] + } + wk.Mixin = string(mixin[:]) +} + +var mixinKeyEncTab = [...]int{ + 46, 47, 18, 2, 53, 8, 23, 32, + 15, 50, 10, 31, 58, 3, 45, 35, + 27, 43, 5, 49, 33, 9, 42, 19, + 29, 28, 14, 39, 12, 38, 41, 13, + 37, 48, 7, 16, 24, 55, 40, 61, + 26, 17, 0, 1, 60, 51, 30, 4, + 22, 25, 54, 21, 56, 59, 6, 63, + 57, 62, 11, 36, 20, 34, 44, 52, +} + +func removeUnwantedChars(v url.Values, chars ...byte) url.Values { + b := []byte(v.Encode()) + for _, c := range chars { + b = bytes.ReplaceAll(b, []byte{c}, nil) + } + s, err := url.ParseQuery(string(b)) + if err != nil { + panic(err) + } + return s +} + +type Nav struct { + Code int `json:"code"` + Message string `json:"message"` + Ttl int `json:"ttl"` + Data struct { + WbiImg struct { + ImgUrl string `json:"img_url"` + SubUrl string `json:"sub_url"` + } `json:"wbi_img"` + + // ...... + } `json:"data"` } ``` From 40eb44fd66cbdc80377fdce57b96cd7cd7b60f2a Mon Sep 17 00:00:00 2001 From: YuHuanTin <51024916+YuHuanTin@users.noreply.github.com> Date: Sun, 6 Apr 2025 17:14:03 +0800 Subject: [PATCH 18/33] Update manage.md --- docs/live/manage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/live/manage.md b/docs/live/manage.md index 319487f..2111097 100644 --- a/docs/live/manage.md +++ b/docs/live/manage.md @@ -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端:
bililink:android_link | +| platform | str | 直播平台 | 必要 | 直播姬(pc):pc_link
web端:
bililink:android_link | | csrf | str | CSRF Token(位于cookie) | 必要 | | **json回复:** From b2a368bfe12584dc8860e7c50fbd2b7ed4dc8c52 Mon Sep 17 00:00:00 2001 From: z0z0r4 Date: Sun, 13 Apr 2025 09:46:30 +0800 Subject: [PATCH 19/33] Update silent_user_manage.md --- docs/live/silent_user_manage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/live/silent_user_manage.md b/docs/live/silent_user_manage.md index 0daa299..a94146f 100644 --- a/docs/live/silent_user_manage.md +++ b/docs/live/silent_user_manage.md @@ -18,7 +18,7 @@ | tuid | str | 要禁言的uid | 必要 | | | msg | str | 要禁言的弹幕内容 | 非必要 | | | mobile_app | str | web | 必要 | 定值"web"即可 | -| hour | str | 禁言时长 | 必要 | -1为永久,0为本场直播 | +| hour | num | 禁言时长 | 必要 | -1为永久,0为本场直播 | | csrf_token | str | CSRF Token | 必要 | cookie中的bili_jct字段 | | csrf | str | CSRF Token | 必要 | cookie中的bili_jct字段 | | visit_id | str | 不明 | 非必要 | | From 7282aa2e358977efb84063a3ef67ccb6ed3d705f Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sat, 8 Feb 2025 02:28:52 +0800 Subject: [PATCH 20/33] fix(bili_ticket.md): referer desc & nodejs code close #1174 --- docs/misc/sign/bili_ticket.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/docs/misc/sign/bili_ticket.md b/docs/misc/sign/bili_ticket.md index 6633b26..c0ed0d8 100644 --- a/docs/misc/sign/bili_ticket.md +++ b/docs/misc/sign/bili_ticket.md @@ -30,6 +30,8 @@ *请求方式: POST* +鉴权方式: 请求头 `Referer` 为空或 `.bilibili.com` 子域下任意页 + **URL参数:** | 参数名 | 类型 | 内容 | 必要性 | 备注 | @@ -279,21 +281,16 @@ async function getBiliTicket(csrf) { 'context[ts]': ts, csrf: csrf || '' }); - try { - const response = await fetch(`${url}?${params.toString()}`, { - method: 'POST', - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' - } - }); - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); + const response = await fetch(`${url}?${params.toString()}`, { + method: 'POST', + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' } - const data = await response.json(); - return data; - } catch (e) { - throw error; + }); + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); } + return response.json(); } (async () => { @@ -301,7 +298,7 @@ async function getBiliTicket(csrf) { const ticketResponse = await getBiliTicket(''); // use empty CSRF here console.log(ticketResponse); } catch (e) { - console.error('Failed to get BiliTicket:', error); + console.error('Failed to get BiliTicket:', e); } })(); ``` From 2338773bebfad018631b0db61f3de394a16269d5 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Fri, 7 Mar 2025 01:03:05 +0800 Subject: [PATCH 21/33] fix(live/silent_user_manage.md): typo close #1124 --- docs/live/silent_user_manage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/live/silent_user_manage.md b/docs/live/silent_user_manage.md index 08f7757..55c7c31 100644 --- a/docs/live/silent_user_manage.md +++ b/docs/live/silent_user_manage.md @@ -72,7 +72,7 @@ curl -X POST 'https://api.live.bilibili.com/xlive/web-ucenter/v1/banned/AddSilen | 参数名 | 类型 | 内容 | 必要性 | 备注 | | ---------- | --- | ---------- | --- | ------------------ | | room_id | str | 直播间Id | 必要 | | -| ps1 | str | 列表页码 | 必要 | | +| ps | str | 列表页码 | 必要 | | | csrf_token | str | CSRF Token | 必要 | cookie中的bili_jct字段 | | csrf | str | CSRF Token | 必要 | cookie中的bili_jct字段 | | visit_id | str | 不明 | 非必要 | | From 759f87c0b2dd1ad04146a20b6a8e1da728c98068 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sun, 9 Mar 2025 01:20:27 +0800 Subject: [PATCH 22/33] fix(creativecenter/season.md): correct mistakes --- docs/creativecenter/season.md | 48 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/creativecenter/season.md b/docs/creativecenter/season.md index 55e6057..472ce32 100644 --- a/docs/creativecenter/season.md +++ b/docs/creativecenter/season.md @@ -357,7 +357,7 @@ curl -G 'https://member.bilibili.com/x2/creative/web/seasons' \ 注: 有人工审核 -**正文参数:** +**正文参数 (application/x-www-form-urlencoded):** | 参数名 | 类型 | 内容 | 必要性 | 备注 | | ------ | ---- | -------- | ------ | ---- | @@ -729,23 +729,23 @@ curl -X POST 'https://member.bilibili.com/x2/creative/web/season/del' \ -## 获取合集中的视频 +## 获取合集小节中的视频 -可以在给合集排序时使用 +> https://member.bilibili.com/x2/creative/web/season/section -> https://member.bilibili.com/x2/creative/web/season/section?id=3898622 - -*请求方式: POST* +*请求方法: GET* 认证方式: Cookie (SESSDATA) -**正文参数 (application/x-www-form-urlencoded):** +可以在给合集排序时使用, 可以获取别人的 + +**URL 参数:** | 参数名 | 类型 | 内容 | 必要性 | 备注 | | ----- | --- | ---- | ----- | --- | | id | num | 合集 ID | 必要 | | -**JSON回复:** +**JSON 回复:** | 字段 | 类型 | 内容 | 备注 | | ------- | ---- | -------- | ---- | @@ -754,31 +754,36 @@ curl -X POST 'https://member.bilibili.com/x2/creative/web/season/del' \ | ttl | num | 1 | | | data | obj | 信息本体 | | -`data`对象: +`data` 对象: | 字段 | 类型 | 内容 | 备注 | | --------- | ---- | ------------ | ---- | -| seasons | obj | 合集信息 | | -| episodes | arr | 合集中的视频 | | +| section | obj | 小节信息 | | +| episodes | arr | 小节中的视频 | | -`seasons`对象: +`data` 对象中的 `section` 对象: | 字段 | 类型 | 内容 | 备注 | | --------- | ---- | ------------ | ---- | -| id | num | 合集 ID | | -| type | num | 合集类型 | | -| cover | str | 合集封面 URL | | -| isEnd | num | 是否已完结? | 0: 未完结 | +| id | num | 小节 ID | | +| type | num | 小节类型 | | +| seasonId | num | 合集 ID | | +| title | str | 小结标题 | | +| order | str | 排序编号? | | +| isEnd | num | 是否已完结? | 0: 未完结 | | state | num | 合集状态? | 0: 正常显示
-6: 正在审核 | | partState | num | 合集分段状态? | 0 | | rejectReason | str | 合集拒绝原因? | | | ctime | num | 创建时间 | | | mtime | num | 修改时间 | | -| epCount | num | 视频总数 | | +| epCount | num | 小节视频总数 | | +| cover | num | 合集封面 | | | show | num | 是否公开? | 1: 公开 | | has_charging_pay | num | 是否充电付费? | 0: 否 | +| Episodes | null | | | +| has_pugv_pay | num | 是否 PUGV 付费? | 0: 否 | -`episodes`数组中的对象: +`data` 对象中的 `episodes`数组中的对象: | 字段 | 类型 | 内容 | 备注 | | --------- | ---- | ------------ | ---- | @@ -803,11 +808,12 @@ curl -X POST 'https://member.bilibili.com/x2/creative/web/season/del' \ **示例:** -获取合集176088的视频列表 `id=3541327` +获取合集小节 176088 的视频 ```shell -curl -X GET 'https://member.bilibili.com/x2/creative/web/season/section?id=176088' \ --b 'SESSDATA=xxx; bili_jct=xxx' +curl -G --url 'https://member.bilibili.com/x2/creative/web/season/section' \ +--url-query 'id=176088' \ +-b 'SESSDATA=xxx' ```
From 1d4c2d9e63de341aeb5cb7ee0622e9f7c8568c96 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Mon, 10 Mar 2025 23:25:10 +0800 Subject: [PATCH 23/33] fix(video/action.md): fav required add_media_ids close #1210 --- docs/video/action.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/video/action.md b/docs/video/action.md index 58ac656..c6ecb1a 100644 --- a/docs/video/action.md +++ b/docs/video/action.md @@ -476,8 +476,8 @@ curl -G 'https://api.bilibili.com/x/web-interface/archive/coins' \ | access_key | str | APP 登录 Token | APP 方式必要 | | | rid | num | 稿件 avid | 必要 | | | type | num | 必须为2 | 必要 | | -| add_media_ids | nums | 需要加入的收藏夹 mlid | 非必要(可选) | 同时添加多个,用`,`(%2C)分隔 | -| del_media_ids | nums | 需要取消的收藏夹 mlid | 非必要(可选) | 同时取消多个,用`,`(%2C)分隔 | +| add_media_ids | nums | 需要加入的收藏夹 mlid | 必要(可选) | 同时添加多个,用`,`(%2C)分隔 | +| del_media_ids | nums | 需要取消的收藏夹 mlid | 必要(可选) | 同时取消多个,用`,`(%2C)分隔 | | csrf | str | CSRF Token(位于 Cookie) | Cookie 方式必要 | | **json回复:** @@ -553,8 +553,8 @@ curl 'https://api.bilibili.com/medialist/gateway/coll/resource/deal' \ | ------------- | ---- | ---------------------------------- | ------------ | ------------------------------ | | rid | num | 稿件 avid | 必要 | | | type | num | 必须为2 | 必要 | | -| add_media_ids | nums | 需要加入的收藏夹 mlid | 非必要(可选) | 同时添加多个,用`,`(%2C)分隔 | -| del_media_ids | nums | 需要取消的收藏夹 mlid | 非必要(可选) | 同时取消多个,用`,`(%2C)分隔 | +| add_media_ids | nums | 需要加入的收藏夹 mlid | 必要(可选) | 同时添加多个,用`,`(%2C)分隔 | +| del_media_ids | nums | 需要取消的收藏夹 mlid | 必要(可选) | 同时取消多个,用`,`(%2C)分隔 | | csrf | str | CSRF Token (即 Cookie 中 bili_jct) | 必要 | | | platform | str | 平台标识? | 非必要 | web端: web | | eab_x | num | 1 | 非必要 | 作用尚不明确 | @@ -584,15 +584,15 @@ curl 'https://api.bilibili.com/medialist/gateway/coll/resource/deal' \ **示例:** -将视频 `av1906473802` 添加到收藏夹 `1164192068` 中 +将视频 `av2` 添加到收藏夹 `645769214` 中 ```shell -curl -sX POST "https://api.bilibili.com/x/v3/fav/resource/deal" \ ---data-urlencode "rid=1906473802" \ ---data-urlencode "type=2" \ +curl -X POST "https://api.bilibili.com/x/v3/fav/resource/deal" \ +--data-urlencode "rid=2" \ +--data-urlencode "type=2" \ --data-urlencode "csrf=xxx" \ ---data-urlencode "add_media_ids=1164192068" \ --b "SESSDATA=xxx; bili_jct=xxx" +--data-urlencode "add_media_ids=1428261914" \ +-b "SESSDATA=xxx" ```
From a9f405a9a06964bfc715b17806a09334a110a96c Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Mon, 24 Mar 2025 00:36:22 +0800 Subject: [PATCH 24/33] feat(search/hot): wbi/search/square --- docs/search/hot.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/search/hot.md b/docs/search/hot.md index bf08331..6c7cdb9 100644 --- a/docs/search/hot.md +++ b/docs/search/hot.md @@ -67,7 +67,8 @@ curl 'https://api.bilibili.com/x/web-interface/search/default' ## 获取热搜列表 -> https://api.bilibili.com/x/web-interface/search/square +> https://api.bilibili.com/x/web-interface/wbi/search/square +> ~~https://api.bilibili.com/x/web-interface/search/square~~ *请求方式: GET* From 02976b22e82cf7841e18cd52316ec65f212f6b95 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sat, 12 Apr 2025 09:31:46 +0800 Subject: [PATCH 25/33] feat: live GetEmotion close #1216 --- README.md | 1 + docs/live/emoticons.md | 927 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 928 insertions(+) create mode 100644 docs/live/emoticons.md diff --git a/README.md b/README.md index d9f93c5..0619f2e 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,7 @@ B站 API 采用 C/S 结构,大多数接口为 REST API 和 gRPC,少部分接 - [ ] [直播视频流](docs/live/live_stream.md) - [ ] [直播信息流](docs/live/message_stream.md) - [ ] [直播红包](docs/live/redpocket.md) + - [ ] [直播间表情包](docs/live/emoticons.md) - [ ] [直播间用户实用 API](docs/live/user.md) - [x] [直播间禁言相关](docs/live/silent_user_manage.md) - [ ] [关注UP直播情况](docs/live/follow_up_live.md) diff --git a/docs/live/emoticons.md b/docs/live/emoticons.md new file mode 100644 index 0000000..75ee998 --- /dev/null +++ b/docs/live/emoticons.md @@ -0,0 +1,927 @@ +# 直播间表情 + +## 获取直播间的表情包 + +> https://api.live.bilibili.com/xlive/web-ucenter/v2/emoticon/GetEmoticons + +*请求方法: GET* + +认证方式: Cookie (SESSDATA) + +**URL 参数:** + +| 参数名 | 类型 | 内容 | 必要性 | 备注 | +| -------- | ------ | ---------- | ------ | ---- | +| platform | string | 平台 | 必要 | 已知: `pc``android` `ios` | +| room_id | number | 直播间长号 | 必要 | 只支持 `room_id` 不支持 `short_id` | + +**JSON 回复:** + +根对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------- | ------ | -------- | ---- | +| code | number | 返回值 | 0: 成功 | +| message | string | 错误消息 | 默认为 0 | +| ttl | number | 1 | | +| data | object | 信息本体 | 见下 | + +`data` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------------ | -------- | ---------- | ---- | +| data | object[] | 表情包数据 | 套了个娃 | +| fans_brand | number | 品牌标识? | | +| purchase_url | null? | 购买链接? | | + +`data.data[]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --------------------- | -------- | --------- | ---- | +| current_cover | string | 封面 URL | | +| emoticons | object[] | 表情列表 | | +| pkg_descript | string | 文字描述 | | +| pkg_id | number | 包 ID | | +| pkg_name | string | 包名称 | | +| pkg_perm | number | 使用权限? | | +| pkg_type | number | 包类型 | | +| recently_used_emoticons | unknown[] | 最近使用的表情 | | +| top_show | object | 顶部展示信息? | | +| top_show_recent | object | 最近使用的顶部展示信息? | | +| unlock_identity | number | 解锁所需身份标识? | | +| unlock_need_gift | number | 解锁所需礼物? | | + +`data.data[].emoticons[]` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| ------------- | ------ | ---- | ---- | +| bulge_display | number | 突出展示? | | +| descript | string | 描述 | | +| emoji | string | 触发关键词? | | +| emoticon_id | number | 表情 ID | | +| emoticon_unique | string | 表情唯一标识 | | +| emoticon_value_type | number | 表情值类型? | | +| height | number | 表情图片高度 | | +| identity | number | 身份限制标识? | | +| in_player_area | number | 播放器区域内展示? | | +| is_dynamic | number | 是否为动态表情? | | +| perm | number | 使用权限? | | +| unlock_need_gift | number | 解锁需求礼物? | | +| unlock_need_level | number | 解锁需求等级? | | +| unlock_show_color | string | 解锁展示颜色? | | +| unlock_show_image | string | 解锁展示图片? | | +| unlock_show_text | string | 解锁展示文字? | | +| url | string | 表情图片 URL | | +| width | number | 表情图片宽度 | | + +`data.data[].top_show` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| --------- | ------ | ---- | ---- | +| top_left | object | | 左上 | +| top_right | object | | 右上 | + +`data.data[].top_show.top_left` 对象: + +| 字段 | 类型 | 内容 | 备注 | +| ----- | ------ | ----- | ---- | +| image | string | 图片? | | +| text | string | 文字 | | + +`data.data[].top_show.top_right` 对象: + +同 `data.data[].top_show.top_left` 对象 + +`data.data[].top_show_recent` 对象: + +同 `data.data[].top_show` 对象 + +`data.data[].top_show_recent.top_left` 对象: + +同 `data.data[].top_show.top_left` 对象 + +`data.data[].top_show_recent.top_right` 对象: + +同 `data.data[].top_show.top_left` 对象 + +**示例:** + +获取直播间 `14047` 的表情包, 平台为 `android` + +```shell +curl -G 'https://api.live.bilibili.com/xlive/web-ucenter/v2/emoticon/GetEmoticons' \ +--url-query 'room_id=14047' \ +--url-query 'platform=android' \ +-b 'SESSDATA=xxx' +``` + +
+查看响应示例: + +```json +{ + "code": 0, + "data": { + "data": [ + { + "current_cover": "http://i0.hdslb.com/bfs/live/39b7667c2601e4da8019472f5e3df1f2278278b6.png", + "emoticons": [ + { + "bulge_display": 0, + "descript": "", + "emoji": "啊", + "emoticon_id": 331, + "emoticon_unique": "official_331", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/cbf2746062242e77bdcb9eb08edbf9b151fe0c2e.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "冲鸭", + "emoticon_id": 332, + "emoticon_unique": "official_332", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/dea7fbbc1c3d3c80f4c7b27263e13460f21874e4.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "upup", + "emoticon_id": 348, + "emoticon_unique": "official_348", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/38d84a4cd2f40069202ee13bbdca5b23d29710fb.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "星星向龙", + "emoticon_id": 343, + "emoticon_unique": "official_343", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/a69423be39b0f2a87dc74f2e44ead70de0eb0d4f.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "欧皇驾到", + "emoticon_id": 335, + "emoticon_unique": "official_335", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/650399e68d0d93df4b3f9e95e7437e83be7fbb1a.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "这个好耶", + "emoticon_id": 345, + "emoticon_unique": "official_345", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/2ce08b31618d3ad0d34877bf949ef0089a0438b7.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "泰裤辣", + "emoticon_id": 339, + "emoticon_unique": "official_339", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/82c38fc930ae764b4c6215f544bf8e1dba73b51c.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "闪避技能", + "emoticon_id": 337, + "emoticon_unique": "official_337", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/fa3febe6c62f3bcd042953141930d96fb8451e60.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "稳住能赢", + "emoticon_id": 342, + "emoticon_unique": "official_342", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/b3495aaa935b045bfc2e1d52738ea7b124e0d552.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "中奖喷雾", + "emoticon_id": 346, + "emoticon_unique": "official_346", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/c3cfa182d16564301d39e4c7e4c186dfb9fabf96.png", + "width": 200 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "赞", + "emoticon_id": 147, + "emoticon_unique": "official_147", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/bbd9045570d0c022a984c637e406cb0e1f208aa9.png", + "width": 150 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "妙啊", + "emoticon_id": 109, + "emoticon_unique": "official_109", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/7b7a2567ad1520f962ee226df777eaf3ca368fbc.png", + "width": 138 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "有点东西", + "emoticon_id": 113, + "emoticon_unique": "official_113", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/39e518474a3673c35245bf6ef8ebfff2c003fdc3.png", + "width": 186 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "很有精神", + "emoticon_id": 150, + "emoticon_unique": "official_150", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/e91cbe30b2db1e624bd964ad1f949661501f42f8.png", + "width": 201 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "泪目", + "emoticon_id": 103, + "emoticon_unique": "official_103", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/aa93b9af7ba03b50df23b64e9afd0d271955cd71.png", + "width": 144 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "赢麻了", + "emoticon_id": 128, + "emoticon_unique": "official_128", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/1d4c71243548a1241f422e90cd8ba2b75c282f6b.png", + "width": 156 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "钝角", + "emoticon_id": 133, + "emoticon_unique": "official_133", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/38cf68c25d9ff5d364468a062fc79571db942ff3.png", + "width": 153 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "干杯", + "emoticon_id": 149, + "emoticon_unique": "official_149", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/8fedede4028a72e71dae31270eedff5f706f7d18.png", + "width": 162 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "2333", + "emoticon_id": 124, + "emoticon_unique": "official_124", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/a98e35996545509188fe4d24bd1a56518ea5af48.png", + "width": 183 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "打call", + "emoticon_id": 146, + "emoticon_unique": "official_146", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/fa1eb4dce3ad198bb8650499830560886ce1116c.png", + "width": 195 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "多谢款待", + "emoticon_id": 148, + "emoticon_unique": "official_148", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/4609dad97c0dfa61f8da0b52ab6fff98e0cf1e58.png", + "width": 207 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "awsl", + "emoticon_id": 102, + "emoticon_unique": "official_102", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/328e93ce9304090f4035e3aa7ef031d015bbc915.png", + "width": 162 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "鸡汤来咯", + "emoticon_id": 137, + "emoticon_unique": "official_137", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/b371151503978177b237afb85185b0f5431d0106.png", + "width": 198 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "雀食", + "emoticon_id": 118, + "emoticon_unique": "official_118", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/7251dc7df587388a3933743bf38394d12a922cd7.png", + "width": 159 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "禁止套娃", + "emoticon_id": 108, + "emoticon_unique": "official_108", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/6a644577437d0bd8a314990dd8ccbec0f3b30c92.png", + "width": 204 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "暗中观察", + "emoticon_id": 104, + "emoticon_unique": "official_104", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/18af5576a4582535a3c828c3ae46a7855d9c6070.png", + "width": 156 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "保熟吗", + "emoticon_id": 105, + "emoticon_unique": "official_105", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/0e28444c8e2faef3169e98e1a41c487144d877d4.png", + "width": 162 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "比心", + "emoticon_id": 106, + "emoticon_unique": "official_106", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/1ba5126b10e5efe3e4e29509d033a37f128beab2.png", + "width": 132 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "咸鱼翻身", + "emoticon_id": 110, + "emoticon_unique": "official_110", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/7db4188c050f55ec59a1629fbc5a53661e4ba780.png", + "width": 180 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "mua", + "emoticon_id": 111, + "emoticon_unique": "official_111", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/08f1aebaa4d9c170aa79cbafe521ef0891bdf2b5.png", + "width": 165 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "来了来了", + "emoticon_id": 115, + "emoticon_unique": "official_115", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/61e790813c51eab55ebe0699df1e9834c90b68ba.png", + "width": 168 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "贴贴", + "emoticon_id": 116, + "emoticon_unique": "official_116", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/88b49dac03bfd5d4cb49672956f78beb2ebd0d0b.png", + "width": 162 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "牛牛牛", + "emoticon_id": 117, + "emoticon_unique": "official_117", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/343f7f7e87fa8a07df63f9cba6b776196d9066f0.png", + "width": 168 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "颠个勺", + "emoticon_id": 119, + "emoticon_unique": "official_119", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/625989e78079e3dc38d75cb9ac392fe8c1aa4a75.png", + "width": 195 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "好家伙", + "emoticon_id": 122, + "emoticon_unique": "official_122", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/c2650bf9bbc79b682a4b67b24df067fdd3e5e9ca.png", + "width": 165 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "下次一定", + "emoticon_id": 125, + "emoticon_unique": "official_125", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/cc2652cef69b22117f1911391567bd2957f27e08.png", + "width": 177 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "不上Ban", + "emoticon_id": 126, + "emoticon_unique": "official_126", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/eff44c1fc03311573e8817ca8010aca72404f65c.png", + "width": 231 + }, + { + "bulge_display": 0, + "descript": "", + "emoji": "上热榜", + "emoticon_id": 134, + "emoticon_unique": "official_134", + "emoticon_value_type": 0, + "height": 60, + "identity": 99, + "in_player_area": 1, + "is_dynamic": 1, + "perm": 1, + "unlock_need_gift": 0, + "unlock_need_level": 0, + "unlock_show_color": "", + "unlock_show_image": "", + "unlock_show_text": "", + "url": "http://i0.hdslb.com/bfs/live/83d5b9cdaaa820c2756c013031d34dac1fd4156b.png", + "width": 168 + } + ], + "pkg_descript": "官方表情(系统)", + "pkg_id": 1, + "pkg_name": "通用表情", + "pkg_perm": 1, + "pkg_type": 1, + "recently_used_emoticons": [], + "top_show": { + "top_left": { + "image": "", + "text": "通用表情" + }, + "top_right": { + "image": "", + "text": "" + } + }, + "top_show_recent": { + "top_left": { + "image": "", + "text": "" + }, + "top_right": { + "image": "", + "text": "" + } + }, + "unlock_identity": 0, + "unlock_need_gift": 0 + } + ], + "fans_brand": 1, + "purchase_url": null + }, + "message": "0", + "ttl": 1 +} +``` +
From 2a8fbd2eabcf7657c6ccf262dbbb3122298b1b39 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sat, 12 Apr 2025 09:43:16 +0800 Subject: [PATCH 26/33] feat: history dt 9 close #1206 --- docs/history&toview/history.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/history&toview/history.md b/docs/history&toview/history.md index a12c3f9..ddecbcf 100644 --- a/docs/history&toview/history.md +++ b/docs/history&toview/history.md @@ -120,7 +120,7 @@ | cid | num | 观看到的对象id | 稿件视频&剧集(当`business=archive`或`business=pgc`时):视频cid
文集(当`business=article-list`时):文章cvid | | part | str | 观看到的视频分 P 标题 | 仅用于稿件视频 | | business | str | 业务类型 | **见请求参数** | -| dt | num | 记录查看的平台代码 | 1 3 5 7:手机端
2:web端
4 6:pad端
33:TV端
0:其他 | +| dt | num | 记录查看的平台代码 | 1 3 5 7:手机端
2:web端
4 6:pad端
9: 智能音箱/游戏机33:TV端
0:其他 | **示例:** From 9d7c2b07d93a2faf690033c6692abde307d8ece5 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sat, 12 Apr 2025 09:49:38 +0800 Subject: [PATCH 27/33] feat(video/report.md): warning and tips for h5 --- docs/video/report.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/video/report.md b/docs/video/report.md index 4cccc92..ef141bc 100644 --- a/docs/video/report.md +++ b/docs/video/report.md @@ -179,7 +179,8 @@ curl 'https://api.bilibili.com/x/click-interface/web/heartbeat' \ 认证方式: Cookie (SESSDATA) -该接口亦被用于计算播放量, 播放量更新不是实时的 +该接口亦被用于计算播放量, 播放量更新不是实时的
+该接口使用似乎存在 200 播放限制, **请勿滥用!** **URL参数:** From 7051e5dbf091cf36790c77b9f7aa0bdf02861b3b Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:59:20 +0800 Subject: [PATCH 28/33] feat(video/videostream_url.md): playurl try_look close #1095 --- docs/video/videostream_url.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/video/videostream_url.md b/docs/video/videostream_url.md index 1c8a19a..ef7196c 100644 --- a/docs/video/videostream_url.md +++ b/docs/video/videostream_url.md @@ -15,7 +15,7 @@ | 6 | 240P 极速 | 仅 MP4 格式支持
仅`platform=html5`时有效 | | 16 | 360P 流畅 | | | 32 | 480P 清晰 | | -| 64 | 720P 高清 | WEB 端默认值
B站前端需要登录才能选择,但是直接发送请求可以不登录就拿到 720P 的取流地址
**无 720P 时则为 720P60** | +| 64 | 720P 高清 | WEB 端默认值
~~B站前端需要登录才能选择,但是直接发送请求可以不登录就拿到 720P 的取流地址~~
**无 720P 时则为 720P60** | | 74 | 720P60 高帧率 | 登录认证 | | 80 | 1080P 高清 | TV 端与 APP 端默认值
登录认证 | | 112 | 1080P+ 高码率 | 大会员认证 | @@ -117,6 +117,7 @@ | type | str | | 非必要 | 目前为空 | | platform | str | | 非必要 | pc:web播放(默认值,视频流存在 referer鉴权)
html5:移动端 HTML5 播放(仅支持 MP4 格式,无 referer 鉴权可以直接使用`video`标签播放) | | high_quality | num | 是否高画质 | 非必要 | platform=html5时,此值为1可使画质为1080p | +| try_look | num | 未登录高画质 | 非必要 | 为 `1` 时可以不登录拉到 `64` 和 `80` 清晰度 | **json回复:** From 687ad1fa582280309fc94d1a60f45ccbe9a6c083 Mon Sep 17 00:00:00 2001 From: SessionHu <102411014+SessionHu@users.noreply.github.com> Date: Sun, 13 Apr 2025 01:34:38 +0800 Subject: [PATCH 29/33] feat(README.md): json-apidoc-gen --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0619f2e..519ffa2 100644 --- a/README.md +++ b/README.md @@ -386,6 +386,7 @@ OR Aifadian:[https://afdian.net/@ShakaiAneE](https://afdian.net/@ShakaiAneE) - [bloomrpc/bloomrpc](https://github.com/bloomrpc/bloomrpc): GUI Client for GRPC Services - [grpc/grpc](https://github.com/grpc/grpc): The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) - [glideapps/quicktype](https://github.com/glideapps/quicktype): quicktype generates strongly-typed models and serializers from JSON, JSON Schema, TypeScript, and GraphQL queries, making it a breeze to work with JSON type-safely in many programming languages. 一键生成多种语言的JSON反序列化所需类,以便于快速反序列化,有网页版 +- [SessionHu/json-apidoc-gen](https://github.com/SessionHu/json-apidoc-gen): Simple CLI tool for generating BAC document template