fix(huya): 风控判定改为按URL路径, strategy=64不再误判为扫码
矩阵实测: 不存在账号/错误密码下发 pt_auth.html(滑块), 正确密码才下发 qr_auth.html(扫码)。旧逻辑把 strategy==64 硬编码当扫码, 把可自动化的 滑块误杀成死路。现仅按 URL 路径 qr_auth 判定。
This commit is contained in:
@@ -33,3 +33,4 @@ data/web.db
|
||||
.reasonix/
|
||||
.tmp_reverse/
|
||||
apks/
|
||||
evidence/qr_login_success.json
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user