fix(huya): 风控判定改为按URL路径, strategy=64不再误判为扫码

矩阵实测: 不存在账号/错误密码下发 pt_auth.html(滑块), 正确密码才下发
qr_auth.html(扫码)。旧逻辑把 strategy==64 硬编码当扫码, 把可自动化的
滑块误杀成死路。现仅按 URL 路径 qr_auth 判定。
This commit is contained in:
yml2213
2026-08-25 11:50:40 +08:00
parent ff99c036f8
commit 0a060bb777
2 changed files with 6 additions and 4 deletions
+1
View File
@@ -33,3 +33,4 @@ data/web.db
.reasonix/ .reasonix/
.tmp_reverse/ .tmp_reverse/
apks/ apks/
evidence/qr_login_success.json
+5 -4
View File
@@ -278,12 +278,13 @@ class HuyaVerificationSolver:
except Exception: # noqa: BLE001 except Exception: # noqa: BLE001
pass pass
strategy_url_lower = strategy_url.lower() strategy_url_lower = strategy_url.lower()
is_qr_auth = "qr_auth" in strategy_url_lower or any( # 判定依据是 URL 路径,不是 strategy 数值。
isinstance(s, dict) and str(s.get("strategy")) == "64" for s in strategies # 实测(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: if is_qr_auth and "dx_auth" not in strategy_url_lower:
raise HuyaQrAuthRequiredError( raise HuyaQrAuthRequiredError(
"虎牙风控要求扫码验证(qr_auth/strategy=64),需已登录App设备确认," "虎牙风控要求扫码验证(qr_auth),需已登录App设备确认,"
f"账号: {self.url_param_map.get('mobile', '?')}" f"账号: {self.url_param_map.get('mobile', '?')}"
) )
if "dx_auth" in strategy_url_lower: if "dx_auth" in strategy_url_lower: