From 0a060bb77742eeacacd0c9e1fd7e1987b574cd93 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Tue, 25 Aug 2026 11:50:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(huya):=20=E9=A3=8E=E6=8E=A7=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E6=94=B9=E4=B8=BA=E6=8C=89URL=E8=B7=AF=E5=BE=84,=20st?= =?UTF-8?q?rategy=3D64=E4=B8=8D=E5=86=8D=E8=AF=AF=E5=88=A4=E4=B8=BA?= =?UTF-8?q?=E6=89=AB=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 矩阵实测: 不存在账号/错误密码下发 pt_auth.html(滑块), 正确密码才下发 qr_auth.html(扫码)。旧逻辑把 strategy==64 硬编码当扫码, 把可自动化的 滑块误杀成死路。现仅按 URL 路径 qr_auth 判定。 --- .gitignore | 1 + core/huya/verification/solver.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 5667af5..85d9223 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ data/web.db .reasonix/ .tmp_reverse/ apks/ +evidence/qr_login_success.json diff --git a/core/huya/verification/solver.py b/core/huya/verification/solver.py index f022f43..dc6c6b9 100644 --- a/core/huya/verification/solver.py +++ b/core/huya/verification/solver.py @@ -278,12 +278,13 @@ class HuyaVerificationSolver: except Exception: # noqa: BLE001 pass strategy_url_lower = strategy_url.lower() - is_qr_auth = "qr_auth" in strategy_url_lower or any( - isinstance(s, dict) and str(s.get("strategy")) == "64" for s in strategies - ) + # 判定依据是 URL 路径,不是 strategy 数值。 + # 实测(2026-08-25): strategy=64 时 pt_auth.html 是滑块、qr_auth.html 才是扫码, + # 旧的 `strategy==64 → 扫码` 硬编码会把可自动化的滑块误杀成死路。 + is_qr_auth = "qr_auth" in strategy_url_lower if is_qr_auth and "dx_auth" not in strategy_url_lower: raise HuyaQrAuthRequiredError( - "虎牙风控要求扫码验证(qr_auth/strategy=64),需已登录App设备确认," + "虎牙风控要求扫码验证(qr_auth),需已登录App设备确认," f"账号: {self.url_param_map.get('mobile', '?')}" ) if "dx_auth" in strategy_url_lower: