fix(tencent): page.goto 加 domcontentloaded + 60s 超时 + 容错,避免首页加载超时导致登录直接失败
This commit is contained in:
@@ -416,7 +416,11 @@ async def tencent_cookie_gen(
|
|||||||
result = _build_login_result(False, "failed", "视频号登录失败", account_file)
|
result = _build_login_result(False, "failed", "视频号登录失败", account_file)
|
||||||
try:
|
try:
|
||||||
page = await context.new_page()
|
page = await context.new_page()
|
||||||
await page.goto(TENCENT_LOGIN_URL)
|
try:
|
||||||
|
await page.goto(TENCENT_LOGIN_URL, wait_until="domcontentloaded", timeout=60000)
|
||||||
|
except Exception as exc:
|
||||||
|
tencent_logger.warning(_msg("⚠️", f"首页加载超时({exc}),尝试继续等待登录页渲染"))
|
||||||
|
await page.wait_for_timeout(3000)
|
||||||
try:
|
try:
|
||||||
qrcode_info = await _save_tencent_qrcode(page, account_file, qrcode_callback=qrcode_callback)
|
qrcode_info = await _save_tencent_qrcode(page, account_file, qrcode_callback=qrcode_callback)
|
||||||
qrcode_path = Path(qrcode_info["image_path"])
|
qrcode_path = Path(qrcode_info["image_path"])
|
||||||
|
|||||||
Reference in New Issue
Block a user