Closed Forgot-Dream closed 1 year ago
目前项目使用t.bilibili.com类型的链接进行抽奖时会崩溃。
问题已经重现,实际情况为api转移到了https://api.bilibili.com/x/polymer/web-dynamic/v1/detail?id={dynamic_id}&features=itemOpusStyle
无cookies响应文本为:
{
"code": 0,
"message": "0",
"ttl": 1,
"data": {
"item": {
"basic": {
"comment_id_str": "669016644742283288",
"comment_type": 17,
"like_icon": {
"action_url": "",
"end_url": "",
"id": 0,
"start_url": ""
},
"rid_str": "669016644698939384"
},
"id_str": "669016644742283288",
"modules": {
"module_author": {
"avatar": {
"container_size": {
"height": 1.35,
"width": 1.35
},
"fallback_layers": {
"is_critical_group": true,
"layers": [
{
"general_spec": {
"pos_spec": {
"axis_x": 0.675,
"axis_y": 0.675,
"coordinate_pos": 2
},
"render_spec": {
"opacity": 1
},
"size_spec": {
"height": 1,
"width": 1
}
},
"layer_config": {
"is_critical": true,
"tags": {
"AVATAR_LAYER": {},
"GENERAL_CFG": {
"config_type": 1,
"general_config": {
"web_css_style": {
"borderRadius": "50%"
}
}
}
}
},
"resource": {
"res_image": {
"image_src": {
"placeholder": 6,
"remote": {
"bfs_style": "widget-layer-avatar",
"url": "https://i0.hdslb.com/bfs/face/8f6a614a48a3813d90da7a11894ae56a59396fcd.jpg"
},
"src_type": 1
}
},
"res_type": 3
},
"visible": true
},
{
"general_spec": {
"pos_spec": {
"axis_x": 0.8000000000000002,
"axis_y": 0.8000000000000002,
"coordinate_pos": 1
},
"render_spec": {
"opacity": 1
},
"size_spec": {
"height": 0.41666666666666663,
"width": 0.41666666666666663
}
},
"layer_config": {
"tags": {
"GENERAL_CFG": {
"config_type": 1,
"general_config": {
"web_css_style": {
"background-color": "rgb(255,255,255)",
"border": "2px solid rgba(255,255,255,1)",
"borderRadius": "50%",
"boxSizing": "border-box"
}
}
},
"ICON_LAYER": {}
}
},
"resource": {
"res_image": {
"image_src": {
"local": 4,
"src_type": 2
}
},
"res_type": 3
},
"visible": true
}
]
},
"mid": "9617619"
},
"face": "https://i0.hdslb.com/bfs/face/8f6a614a48a3813d90da7a11894ae56a59396fcd.jpg",
"face_nft": false,
"following": null,
"jump_url": "//space.bilibili.com/9617619/dynamic",
"label": "",
"mid": 9617619,
"name": "哔哩哔哩直播",
"official_verify": {
"desc": "",
"type": 1
},
"pendant": {
"expire": 0,
"image": "",
"image_enhance": "",
"image_enhance_frame": "",
"name": "",
"pid": 0
},
"pub_action": "",
"pub_location_text": "",
"pub_time": "2022年06月07日 20:46",
"pub_ts": 1654605976,
"type": "AUTHOR_TYPE_NORMAL",
"vip": {
"avatar_subscript": 1,
"avatar_subscript_url": "",
"due_date": 1697817600000,
"label": {
"bg_color": "#FB7299",
"bg_style": 1,
"border_color": "",
"img_label_uri_hans": "",
"img_label_uri_hans_static": "https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png",
"img_label_uri_hant": "",
"img_label_uri_hant_static": "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png",
"label_theme": "annual_vip",
"path": "",
"text": "年度大会员",
"text_color": "#FFFFFF",
"use_img_label": true
},
"nickname_color": "#FB7299",
"status": 1,
"theme_type": 0,
"type": 2
}
},
"module_dynamic": {
"additional": null,
"desc": {
"rich_text_nodes": [
{
"orig_text": "6月8日KPL首届夏季赛火热开赛,明星主播花式解说!开赛首日直播间礼品不定时掉落,记得好好蹲守哦~明天15点,2022KPL夏季赛我们不见不散\u003e\u003e\u003e",
"text": "6月8日KPL首届夏季赛火热开赛,明星主播花式解说!开赛首日直播间礼品不定时掉落,记得好好蹲守哦~明天15点,2022KPL夏季赛我们不见不散\u003e\u003e\u003e",
"type": "RICH_TEXT_NODE_TYPE_TEXT"
},
{
"jump_url": "https://live.bilibili.com/55",
"orig_text": "https://live.bilibili.com/55",
"text": "网页链接",
"type": "RICH_TEXT_NODE_TYPE_WEB"
}
],
"text": "6月8日KPL首届夏季赛火热开赛,明星主播花式解说!开赛首日直播间礼品不定时掉落,记得好好蹲守哦~明天15点,2022KPL夏季赛我们不见不散\u003e\u003e\u003ehttps://live.bilibili.com/55"
},
"major": null,
"topic": null
},
"module_more": {
"three_point_items": [
{
"label": "举报",
"type": "THREE_POINT_REPORT"
}
]
},
"module_stat": {
"comment": {
"count": 44,
"forbidden": false
},
"forward": {
"count": 15,
"forbidden": false
},
"like": {
"count": 2381,
"forbidden": false,
"status": false
}
}
},
"orig": {
"basic": {
"comment_id_str": "",
"comment_type": 0,
"jump_url": "//www.bilibili.com/opus/669007814298959974",
"like_icon": {
"action_url": "",
"end_url": "",
"id": 0,
"start_url": ""
},
"rid_str": ""
},
"id_str": "669007814298959974",
"modules": {
"module_author": {
"avatar": {
"container_size": {
"height": 1.35,
"width": 1.35
},
"fallback_layers": {
"is_critical_group": true,
"layers": [
{
"general_spec": {
"pos_spec": {
"axis_x": 0.675,
"axis_y": 0.675,
"coordinate_pos": 2
},
"render_spec": {
"opacity": 1
},
"size_spec": {
"height": 1,
"width": 1
}
},
"layer_config": {
"is_critical": true,
"tags": {
"AVATAR_LAYER": {},
"GENERAL_CFG": {
"config_type": 1,
"general_config": {
"web_css_style": {
"borderRadius": "50%"
}
}
}
}
},
"resource": {
"res_image": {
"image_src": {
"placeholder": 6,
"remote": {
"bfs_style": "widget-layer-avatar",
"url": "https://i0.hdslb.com/bfs/face/df9bb92bae388740db3869a4e2c76448c01e1d0c.jpg"
},
"src_type": 1
}
},
"res_type": 3
},
"visible": true
},
{
"general_spec": {
"pos_spec": {
"axis_x": 0.8000000000000002,
"axis_y": 0.8000000000000002,
"coordinate_pos": 1
},
"render_spec": {
"opacity": 1
},
"size_spec": {
"height": 0.41666666666666663,
"width": 0.41666666666666663
}
},
"layer_config": {
"tags": {
"GENERAL_CFG": {
"config_type": 1,
"general_config": {
"web_css_style": {
"background-color": "rgb(255,255,255)",
"border": "2px solid rgba(255,255,255,1)",
"borderRadius": "50%",
"boxSizing": "border-box"
}
}
},
"ICON_LAYER": {}
}
},
"resource": {
"res_image": {
"image_src": {
"local": 4,
"src_type": 2
}
},
"res_type": 3
},
"visible": true
}
]
},
"mid": "392836434"
},
"decorate": {
"card_url": "https://i0.hdslb.com/bfs/garb/item/30327669cc0b5b94b8c0bca32d14d66298017851.png",
"fan": {
"color": "#dbba90",
"is_fan": true,
"num_str": "000001",
"number": 1
},
"id": 41253,
"jump_url": "https://www.bilibili.com/h5/mall/equity-link/home?navhide=1\u0026item_id=41284\u0026part=card\u0026f_source=garb\u0026from=post\u0026isdiy=0",
"name": "2022王者荣耀世冠粉丝",
"type": 3
},
"face": "https://i0.hdslb.com/bfs/face/df9bb92bae388740db3869a4e2c76448c01e1d0c.jpg",
"face_nft": false,
"following": null,
"jump_url": "//space.bilibili.com/392836434/dynamic",
"label": "",
"mid": 392836434,
"name": "哔哩哔哩王者荣耀赛事",
"official_verify": {
"desc": "",
"type": 1
},
"pendant": {
"expire": 0,
"image": "",
"image_enhance": "",
"image_enhance_frame": "",
"name": "",
"pid": 0
},
"pub_action": "",
"pub_time": "",
"pub_ts": 1654603920,
"type": "AUTHOR_TYPE_NORMAL",
"vip": {
"avatar_subscript": 1,
"avatar_subscript_url": "",
"due_date": 1693843200000,
"label": {
"bg_color": "#FB7299",
"bg_style": 1,
"border_color": "",
"img_label_uri_hans": "",
"img_label_uri_hans_static": "https://i0.hdslb.com/bfs/vip/8d4f8bfc713826a5412a0a27eaaac4d6b9ede1d9.png",
"img_label_uri_hant": "",
"img_label_uri_hant_static": "https://i0.hdslb.com/bfs/activity-plat/static/20220614/e369244d0b14644f5e1a06431e22a4d5/VEW8fCC0hg.png",
"label_theme": "annual_vip",
"path": "",
"text": "年度大会员",
"text_color": "#FFFFFF",
"use_img_label": true
},
"nickname_color": "#FB7299",
"status": 1,
"theme_type": 0,
"type": 2
}
},
"module_dynamic": {
"additional": null,
"desc": {
"rich_text_nodes": [
{
"orig_text": "互动抽奖",
"rid": "96074",
"text": "互动抽奖",
"type": "RICH_TEXT_NODE_TYPE_LOTTERY"
},
{
"orig_text": " 【上B站,看KPL】\r\nKPL首届夏季赛即将来袭,6月8日15:00B站55官方直播间等你来看!你最期待哪场对决呢?更有多位明星主播陪你观赛,趣味吐槽花式解说开赛首日~\r\n\r\n55直播间马超-无双飞将皮肤助力金撒不停,赛事全程天选好礼每局掉落,观赛还能领取游戏内道具!APP端参与直播间【热议】讨论,更有机会获超多奖励。\r\n\r\nKPL赛事征稿开赛日同步上线,带",
"text": " 【上B站,看KPL】\r\nKPL首届夏季赛即将来袭,6月8日15:00B站55官方直播间等你来看!你最期待哪场对决呢?更有多位明星主播陪你观赛,趣味吐槽花式解说开赛首日~\r\n\r\n55直播间马超-无双飞将皮肤助力金撒不停,赛事全程天选好礼每局掉落,观赛还能领取游戏内道具!APP端参与直播间【热议】讨论,更有机会获超多奖励。\r\n\r\nKPL赛事征稿开赛日同步上线,带",
"type": "RICH_TEXT_NODE_TYPE_TEXT"
},
{
"jump_url": "//search.bilibili.com/all?keyword=KPL%E6%BF%80%E5%8A%B1%E8%AE%A1%E5%88%92",
"orig_text": "#KPL激励计划#",
"text": "#KPL激励计划#",
"type": "RICH_TEXT_NODE_TYPE_TOPIC"
},
{
"orig_text": "话题投稿,瓜分30万奖金~\r\n战火将燃,谁将勇夺开门红,让我们拭目以待! ",
"text": "话题投稿,瓜分30万奖金~\r\n战火将燃,谁将勇夺开门红,让我们拭目以待! ",
"type": "RICH_TEXT_NODE_TYPE_TEXT"
},
{
"emoji": {
"icon_url": "https://i0.hdslb.com/bfs/emote/431432c43da3ee5aab5b0e4f8931953e649e9975.png",
"size": 1,
"text": "[打call]",
"type": 1
},
"orig_text": "[打call]",
"text": "[打call]",
"type": "RICH_TEXT_NODE_TYPE_EMOJI"
},
{
"orig_text": "\n\n直播间TP:",
"text": "\n\n直播间TP:",
"type": "RICH_TEXT_NODE_TYPE_TEXT"
},
{
"jump_url": "https://live.bilibili.com/55",
"orig_text": "https://live.bilibili.com/55",
"text": "网页链接",
"type": "RICH_TEXT_NODE_TYPE_WEB"
},
{
"orig_text": " \n赛事预测:",
"text": " \n赛事预测:",
"type": "RICH_TEXT_NODE_TYPE_TEXT"
},
{
"jump_url": "https://www.bilibili.com/v/game/match/competition?spm_id_from=444.42.0.0",
"orig_text": "https://www.bilibili.com/v/game/match/competition?spm_id_from=444.42.0.0",
"text": "网页链接",
"type": "RICH_TEXT_NODE_TYPE_WEB"
},
{
"orig_text": " \n更多比赛:",
"text": " \n更多比赛:",
"type": "RICH_TEXT_NODE_TYPE_TEXT"
},
{
"jump_url": "https://www.bilibili.com/v/game/match/schedule?mid=0\u0026gid=0\u0026tid=0\u0026time=1639785600000\u0026spm_id_from=444.42.0.0",
"orig_text": "https://www.bilibili.com/v/game/match/schedule?mid=0\u0026gid=0\u0026tid=0\u0026time=1639785600000\u0026spm_id_from=444.42.0.0",
"text": "网页链接",
"type": "RICH_TEXT_NODE_TYPE_WEB"
}
],
"text": "互动抽奖 【上B站,看KPL】\r\nKPL首届夏季赛即将来袭,6月8日15:00B站55官方直播间等你来看!你最期待哪场对决呢?更有多位明星主播陪你观赛,趣味吐槽花式解说开赛首日~\r\n\r\n55直播间马超-无双飞将皮肤助力金撒不停,赛事全程天选好礼每局掉落,观赛还能领取游戏内道具!APP端参与直播间【热议】讨论,更有机会获超多奖励。\r\n\r\nKPL赛事征稿开赛日同步上线,带#KPL激励计划#话题投稿,瓜分30万奖金~\r\n战火将燃,谁将勇夺开门红,让我们拭目以待! [打call]\n\n直播间TP:https://live.bilibili.com/55 \n赛事预测:https://www.bilibili.com/v/game/match/competition?spm_id_from=444.42.0.0 \n更多比赛:https://www.bilibili.com/v/game/match/schedule?mid=0\u0026gid=0\u0026tid=0\u0026time=1639785600000\u0026spm_id_from=444.42.0.0"
},
"major": {
"draw": {
"id": 196658860,
"items": [
{
"height": 6758,
"size": 4693.325,
"src": "https://i0.hdslb.com/bfs/album/d4fd33fe00c80938daf6f14641f15901bc4a0d17.jpg",
"tags": [],
"width": 1080
}
]
},
"type": "MAJOR_TYPE_DRAW"
},
"topic": {
"id": 38783,
"jump_url": "https://m.bilibili.com/topic-detail?topic_id=38783\u0026topic_name=2022KPL%E5%A4%8F%E5%AD%A3%E8%B5%9B",
"name": "2022KPL夏季赛"
}
}
},
"type": "DYNAMIC_TYPE_DRAW",
"visible": true
},
"type": "DYNAMIC_TYPE_FORWARD",
"visible": true
}
}
}
由于目前B站动态默认页面已经转移到opus下,具体需求不明,所以t.bilibili.com的问题在短期内估计我不会腾时间解决,如果你愿意对代码进行修改的话,欢迎提pull request。
期望的响应
实际的响应
目前的问题:会导致本项目的t.bilibili.com类型抽奖失效,在获取动态真实ID时崩溃。
经过我个人测试,发现附带登录态cookie时,才是期望响应,可以推断B站对API进行了鉴权,目前新版API还未鉴权,建议迁移至新的API(即综合动态API)