From d380a9aaccf1e863debbe6a7548394fe6cd8d9db Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Wed, 24 Nov 2021 14:32:46 +0800 Subject: [PATCH] Update data_source.py --- plugins/pix_gallery/data_source.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/pix_gallery/data_source.py b/plugins/pix_gallery/data_source.py index 02788b8b..37bb3fb8 100755 --- a/plugins/pix_gallery/data_source.py +++ b/plugins/pix_gallery/data_source.py @@ -30,7 +30,10 @@ headers = { "Referer": "https://www.pixiv.net", } -HIBIAPI = None +HIBIAPI = Config.get_config("hibiapi", "HIBIAPI") +if not HIBIAPI: + HIBIAPI = "https://api.obfs.dev" +HIBIAPI = HIBIAPI[:-1] if HIBIAPI[-1] == "/" else HIBIAPI async def start_update_image_url( @@ -47,9 +50,6 @@ async def start_update_image_url( pic_count = 0 tasks = [] semaphore = asyncio.Semaphore(10) - if not HIBIAPI: - HIBIAPI = Config.get_config("hibiapi", "HIBIAPI") - HIBIAPI = HIBIAPI[:-1] if HIBIAPI[-1] else HIBIAPI for keyword in current_keyword: for page in range(1, 110): if keyword.startswith("uid:"): @@ -390,3 +390,6 @@ def _check_black(img_urls: List[str], black: List[str]) -> bool: if b in img_url: return False return True + + +