From a671bd0c6115d2fd17ada2ba0a71640325d0e086 Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Mon, 28 Oct 2024 21:47:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8DB=E7=AB=99?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=8C=BF=E5=90=8DCookie=E9=80=BB=E8=BE=91=20?= =?UTF-8?q?(#644)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_bison/platform/bilibili/scheduler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nonebot_bison/platform/bilibili/scheduler.py b/nonebot_bison/platform/bilibili/scheduler.py index 0380683..2d48fd3 100644 --- a/nonebot_bison/platform/bilibili/scheduler.py +++ b/nonebot_bison/platform/bilibili/scheduler.py @@ -29,7 +29,9 @@ class BilibiliClientManager(ClientManager): browser = await get_browser() async with await browser.new_page() as page: await page.goto(f"https://space.bilibili.com/{random.randint(1, 1000)}/dynamic") - await page.wait_for_load_state("load") + await page.wait_for_load_state("load") # 等待基本加载完成 + await page.wait_for_function('document.cookie.includes("bili_ticket")') # 期望保证 GenWebTicket 请求完成 + await page.wait_for_load_state("networkidle") # 期望保证 ExClimbWuzhi 请求完成 cookies = await page.context.cookies() return cookies From d4f45571b35df56f74474e83b8facb54c75b3225 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 28 Oct 2024 13:47:35 +0000 Subject: [PATCH 2/2] :memo: Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2fac35..f2f39f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - :sparkles: 更新默认UA为Windows平台 [@suyiiyii](https://github.com/suyiiyii) ([#643](https://github.com/MountainDash/nonebot-bison/pull/643)) +### Bug 修复 + +- :bug: 修复B站获取匿名Cookie逻辑 [@suyiiyii](https://github.com/suyiiyii) ([#644](https://github.com/MountainDash/nonebot-bison/pull/644)) + ### 文档 - 📝 小刻食堂剪彩文档 [@phidiaLam](https://github.com/phidiaLam) ([#636](https://github.com/MountainDash/nonebot-bison/pull/636))