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 -2
View File
@@ -23,6 +23,7 @@ from ..models import (
from ..models import (
ProxyConfig as ProxyConfigModel,
)
from .douyu_account_probe import activity_client
from .douyu_goods_service import upsert_goods_snapshot
from .douyu_service import (
DOUYU_CONFIG_FIELDS,
@@ -411,9 +412,9 @@ class DouyuBatchRunnerCore:
def _client(self, cookie: str) -> DouyuActivityClient:
"""任务 HTTP 客户端:写操作任务注入会话级代理(兑换/锁单/支付/充值/送礼),
读操作任务直连;见 DOUYU_PROXY_TASK_TYPES。"""
return DouyuActivityClient(
return activity_client(
cookie,
logger=lambda msg: self._push_log("debug", msg),
logger_callback=lambda msg: self._push_log("debug", msg),
proxies=self._proxies_for_task(),
)