feat(douyu): unify account probes and lifecycle writes

Centralize Douyu client creation, CK session probing, identity refresh, role alias resolution, capability persistence, cache and batch throttling across collaboration, fulfillment, tasks and cookie management. Add the account-name copy action in the collaboration table.
This commit is contained in:
yml
2026-11-20 01:55:25 +08:00
parent e9937419cb
commit 1a49bcd481
24 changed files with 2162 additions and 639 deletions
+3 -6
View File
@@ -10,7 +10,6 @@ from loguru import logger
from sqlalchemy import and_, func, select
from sqlalchemy.orm import Session
from core.douyu.activity_client import DouyuActivityClient
from core.douyu.cookie_utils import cookie_value
from ..models import Account, DouyuConfig, DouyuTask, LoginTask
@@ -362,11 +361,9 @@ def _lock_payment_accounts(
def update_account_profile_from_cookie(account: Account, cookie: str) -> None:
"""从 Cookie 回填 uid/nickname。"""
profile = DouyuActivityClient.profile_from_cookie(cookie)
if profile["uid"]:
account.uid = profile["uid"]
if profile["nickname"]:
account.nickname = profile["nickname"]
from .douyu_account_probe import update_identity_from_cookie
update_identity_from_cookie(account, cookie)
def account_uid(account: Account, cookie: str) -> str: