fix
This commit is contained in:
parent
8e7c1ed7bf
commit
a5ac330029
@ -141,7 +141,7 @@ class baseComic:
|
|||||||
is_next = verUtils.verNextCBZ(list_img)
|
is_next = verUtils.verNextCBZ(list_img)
|
||||||
repeat = 1
|
repeat = 1
|
||||||
while not is_next and repeat <= 2:
|
while not is_next and repeat <= 2:
|
||||||
download_images(list_img,ci.getDirComicChapter(), files_name=files_name,timeout=60)
|
download_images(list_img,ci.getDirComicChapter(), files_name=files_name,concurrency=10,timeout=60)
|
||||||
is_next = len(",".join(os.listdir(ci.getDirComicChapter())).split(".jpg"))-1 == len(list_img)
|
is_next = len(",".join(os.listdir(ci.getDirComicChapter())).split(".jpg"))-1 == len(list_img)
|
||||||
if not is_next:
|
if not is_next:
|
||||||
sleep_time = 3+int(repeat)*2
|
sleep_time = 3+int(repeat)*2
|
||||||
|
|||||||
@ -68,7 +68,7 @@ def download_image(image_url, dst_dir, file_name, timeout=20, proxy_type=None, p
|
|||||||
print("## Fail: {} {}".format(image_url, e.args))
|
print("## Fail: {} {}".format(image_url, e.args))
|
||||||
|
|
||||||
|
|
||||||
def download_images(image_urls, dst_dir,timeout=30,proxy_type=None, proxy=None,files_name=None):
|
def download_images(image_urls, dst_dir,concurrency=None,timeout=30,proxy_type=None, proxy=None,files_name=None):
|
||||||
"""
|
"""
|
||||||
Download image according to given urls and automatically rename them in order.
|
Download image according to given urls and automatically rename them in order.
|
||||||
:param timeout:
|
:param timeout:
|
||||||
@ -80,7 +80,8 @@ def download_images(image_urls, dst_dir,timeout=30,proxy_type=None, proxy=None,f
|
|||||||
:param concurrency: number of requests process simultaneously
|
:param concurrency: number of requests process simultaneously
|
||||||
:return: none
|
:return: none
|
||||||
"""
|
"""
|
||||||
concurrency = len(image_urls)
|
if concurrency == None:
|
||||||
|
concurrency = len(image_urls)
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=concurrency) as executor:
|
with concurrent.futures.ThreadPoolExecutor(max_workers=concurrency) as executor:
|
||||||
future_list = list()
|
future_list = list()
|
||||||
count = 0
|
count = 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user