diff --git a/list.json b/list.json index af34c78..d8c036b 100644 --- a/list.json +++ b/list.json @@ -952,7 +952,7 @@ }, { "name": "pixiv", - "version": "1.01", + "version": "1.02", "section": "chat", "maintainer": "ricky8955555", "size": "7.851 kb", diff --git a/pixiv/main.py b/pixiv/main.py index 69241ff..55a2e51 100644 --- a/pixiv/main.py +++ b/pixiv/main.py @@ -141,7 +141,7 @@ def illust_sensitive_content_filter( def illust_filter_by_tags(illusts: List[Illust], keywords: str) -> List[Illust]: needed = set(keywords.split()) - return [illust for illust in illusts if needed.intersection(illust.tags) or True] + return [illust for illust in illusts if (needed.intersection(illust.tags) if needed else True)] async def get_api() -> AppPixivAPI: @@ -158,13 +158,13 @@ async def get_api() -> AppPixivAPI: return pixiv_api -@scheduler.scheduled_job("interval", minutes=30, id="pixiv_refresh_token") -async def refresh_token() -> None: - if PluginConfig.refresh_token is None: +@scheduler.scheduled_job("interval", minutes=30, id="pixiv_fetch_token") +async def fetch_token() -> None: + if not PluginConfig.refresh_token: return api = await get_api() if api: - await api.auth(refresh_token=PluginConfig.refresh_token) + await api.login(refresh_token=PluginConfig.refresh_token) async def send_illust(client: Client, chat_id: int, illust: Illust) -> None: