根据数据库的修改对应的逻辑,同时移除多余的init_cookie和_check_cookie

This commit is contained in:
2024-09-13 00:59:19 +08:00
parent af246df222
commit 16331b50d5
3 changed files with 21 additions and 25 deletions
+5 -2
View File
@@ -1,3 +1,5 @@
from typing import cast
from nonebot.log import logger
from ..utils import Site
@@ -7,7 +9,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
from ..utils.site import CookieClientManager, is_cookie_client_manager
scheduler_dict: dict[type[Site], Scheduler] = {}
@@ -32,7 +34,8 @@ async def init_scheduler():
_schedule_class_platform_dict[site].append(platform_name)
for site, target_list in _schedule_class_dict.items():
if is_cookie_client_manager(site.client_mgr):
await site.client_mgr.refresh_universal_cookie()
client_mgr = cast(CookieClientManager, site.client_mgr)
await client_mgr.refresh_anonymous_cookie()
if not plugin_config.bison_use_browser and site.require_browser:
logger.warning(f"{site.name} requires browser, it will not schedule.")
continue