fix(douyu): 区分平台账号与客户游戏账号换绑冷却

This commit is contained in:
yml
2026-11-22 23:02:59 +08:00
parent 053461b353
commit 4b57f9b2a7
4 changed files with 23 additions and 7 deletions
+10 -6
View File
@@ -291,17 +291,21 @@ def is_platform_account_bind_cooldown(
) -> bool:
"""是否为斗鱼平台账号自身的换绑冷却。
2026-11-22 换绑失败 HAR 中 ``actBind`` 返回 ``-200001``:
“该平台账号未到可换绑时间,请使用其他平台账号”。它限制的是当前斗鱼号,
不是用户扫码选择的腾讯游戏角色;提示和人工处理都必须区分两者。
两种冷却都是 ``-200001``,必须继续用文案区分:
- “该平台账号未到可换绑时间,请使用其他平台账号”:斗鱼账号冷却;
- “该账号未到可换绑时间,请使用其他账号”:客户游戏账号冷却。
"""
try:
normalized_code = int(error_code)
except (TypeError, ValueError):
normalized_code = None
return normalized_code == -200001 or "该平台账号未到可换绑时间" in (
message or ""
)
text = str(message or "")
if "该平台账号未到可换绑时间" in text:
return True
if "该账号未到可换绑时间" in text or "请使用其他账号" in text:
return False
return normalized_code == -200001
def binding_pending_decision(