fix(huya): 🔒 一号一设备缺口修复 — hydevice 指纹状态按账号隔离
日志证据: 两账号 sdid 前缀相同 (0UnHUgv0_qmfD4KAKlwzh...) — get_huya_sdid 默认用全局临时目录, 所有账号共享同一份 hydevice 设备采集状态 → 服务端可 跨账号关联设备, 违背一号一环境。 - device_fingerprint: 新增 account_state_dir(account) → data/huya_fp_states/<账号>/ (持久化, 同账号多次登录=同一台'设备') - app_login 扫码绑定四步流 + login.prepare_device: 传入账号级 state_dir
This commit is contained in:
+4
-2
@@ -226,10 +226,12 @@ class HuyaPasswordLogin:
|
||||
|
||||
def prepare_device(self) -> str:
|
||||
"""获取虎牙风控 sdid(优先 hydevice 高信任指纹,失败降级旧版)。"""
|
||||
from .device_fingerprint import get_huya_sdid
|
||||
from .device_fingerprint import account_state_dir, get_huya_sdid
|
||||
|
||||
try:
|
||||
result = get_huya_sdid(app_id="5008", timeout=self.timeout)
|
||||
# 一号一设备: 每账号独立 hydevice 状态, sdid/40hex hdid 不跨账号同源
|
||||
result = get_huya_sdid(app_id="5008", timeout=self.timeout,
|
||||
state_dir=account_state_dir(self.username))
|
||||
if result.sdid:
|
||||
self.sdid = result.sdid
|
||||
self.sdid_source = result.source
|
||||
|
||||
Reference in New Issue
Block a user