From 703feb8ca3ba59bfc3ef1e0c5b7ded5b6aaa3599 Mon Sep 17 00:00:00 2001 From: SebClem Date: Thu, 2 Nov 2023 21:42:14 +0100 Subject: [PATCH] Fix max thread to 10 because au pool size --- src/pixiv/pixiv_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pixiv/pixiv_api.py b/src/pixiv/pixiv_api.py index 0968774..403d251 100644 --- a/src/pixiv/pixiv_api.py +++ b/src/pixiv/pixiv_api.py @@ -9,6 +9,8 @@ import pixivpy3 cpu_count = os.cpu_count() max_thread_num = cpu_count * 2 if cpu_count is not None else 4 +if max_thread_num > 10: + max_thread_num = 10 def dowload_pixiv_images( @@ -22,6 +24,7 @@ def dowload_pixiv_images( json_result = api.illust_detail(illust_id) illust = json_result.illust if not illust["visible"]: + logging.info("Can't be viewed, return None") return None pages = illust["meta_pages"] if len(pages) > 0: