集中判断是否为CookieClientManager

This commit is contained in:
2024-09-06 00:34:52 +08:00
parent 0ce2893911
commit 6537f01a34
3 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ from ..config.db_model import Target
from ..types import Target as T_Target
from ..platform import platform_manager
from ..plugin_config import plugin_config
from ..utils.site import is_cookie_client_manager
scheduler_dict: dict[type[Site], Scheduler] = {}
@@ -30,7 +31,7 @@ async def init_scheduler():
else:
_schedule_class_platform_dict[site].append(platform_name)
for site, target_list in _schedule_class_dict.items():
if hasattr(site.client_mgr, "_cookie_client_manger_"):
if is_cookie_client_manager(site.client_mgr):
await site.client_mgr.init_universal_cookie()
if not plugin_config.bison_use_browser and site.require_browser:
logger.warning(f"{site.name} requires browser, it will not schedule.")