双份cookie存储:raw_cookie 保存App原始凭据,与网页运行ck分离
网页运行ck(cookie列)含本地随机生成的网页设备字段,若被风控标记 无法还原纯净登录凭据;新增 raw_cookie 保存16字段App原始态,供 设备态重建/审计/复核登录有效性。 - HuyaAccount 加 raw_cookie 列(alembic 0034,MySQL TEXT nullable) - HuyaLoginResult 加 raw_cookie 字段;App登录链补齐前快照原始凭据 - upsert_huya_cookie 支持双写;app-password-login 路由透传 raw_cookie - 存量行 raw_cookie 为 NULL(老账号无快照),新登录自动填充
This commit is contained in:
@@ -833,6 +833,7 @@ class HuyaAppPasswordLogin:
|
||||
code="COOKIE_INCOMPLETE",
|
||||
)
|
||||
|
||||
raw_cookie_str = cookie_str # 补齐前 = App 原始登录凭据(16 字段 udb_*)
|
||||
# 补齐网页设备字段并修正 appId:真实网页登录态是 41 字段 +
|
||||
# udb_appid=5002,App 扫码链只产出 16 个 udb_* 认证字段且 appId=5008
|
||||
# (App 渠道),缺字段注入浏览器会导致 UDB SDK 判定设备态不完整。
|
||||
@@ -857,6 +858,7 @@ class HuyaAppPasswordLogin:
|
||||
return HuyaLoginResult(
|
||||
success=True,
|
||||
cookie=cookie_str,
|
||||
raw_cookie=raw_cookie_str,
|
||||
message="App协议登录成功",
|
||||
sdid=sdid,
|
||||
context=pc.context,
|
||||
|
||||
@@ -62,6 +62,7 @@ class HuyaLoginResult:
|
||||
|
||||
success: bool
|
||||
cookie: str = ""
|
||||
raw_cookie: str = "" # App 原始登录凭据(不含网页设备字段),用于设备态重建/审计
|
||||
message: str = ""
|
||||
code: int | str = ""
|
||||
raw: dict | None = None
|
||||
|
||||
Reference in New Issue
Block a user