fix(tencent): page.goto 加 domcontentloaded + 60s 超时 + 容错,避免首页加载超时导致登录直接失败

This commit is contained in:
Qiufeng
2026-08-21 16:59:17 +08:00
parent d34711062d
commit 583a7a3465
+5 -1
View File
@@ -416,7 +416,11 @@ async def tencent_cookie_gen(
result = _build_login_result(False, "failed", "视频号登录失败", account_file)
try:
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:
qrcode_info = await _save_tencent_qrcode(page, account_file, qrcode_callback=qrcode_callback)
qrcode_path = Path(qrcode_info["image_path"])