fix(weibo): 将支付风控检测并入账号 CK 校验

This commit is contained in:
yml2213
2026-11-08 10:29:33 +08:00
parent ffbe0f41f5
commit dd3508d614
4 changed files with 282 additions and 31 deletions
+6 -2
View File
@@ -80,7 +80,9 @@ def import_weibo_cookies(
continue
try:
cookie = normalize_weibo_cookie(raw)
snapshot = WeiboClient(cookie).fetch_home(activity)
client = WeiboClient(cookie)
snapshot = client.fetch_home(activity)
client.check_payment_access(activity, home=snapshot)
except (ValueError, WeiboError) as exc:
errors.append(WeiboImportIssue(line=line_no, message=str(exc)))
continue
@@ -117,7 +119,9 @@ def refresh_weibo_account(
"""刷新一个微博账号;失败时保留旧资料并记录本次检查状态。"""
try:
snapshot = WeiboClient(account.cookie or "").fetch_home(activity)
client = WeiboClient(account.cookie or "")
snapshot = client.fetch_home(activity)
client.check_payment_access(activity, home=snapshot)
except (WeiboError, ValueError) as exc:
account.ck_check_status = _error_status(exc)
account.ck_check_message = str(exc)