mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-08-31 12:02:24 +08:00
🐛 修复B站获取匿名Cookie逻辑 (#644)
This commit is contained in:
parent
08ba7b0e3b
commit
a671bd0c61
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user