Fix max thread to 10 because au pool size
This commit is contained in:
parent
bc5683cd72
commit
703feb8ca3
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user