fix
This commit is contained in:
parent
815ad1f108
commit
d1ca41de63
2
main.py
2
main.py
@ -16,6 +16,6 @@ if __name__ == '__main__':
|
||||
comics()
|
||||
except:
|
||||
dirComic = comicInfo.getDirComic()
|
||||
if not dirComic == None and os.path.exists(dirComic):
|
||||
if dirComic != None and os.path.exists(dirComic):
|
||||
shutil.rmtree(dirComic)
|
||||
comics()
|
||||
@ -39,6 +39,7 @@ def download_image(image_url, dst_dir, file_name, timeout=20, proxy_type=None, p
|
||||
response = requests.get(
|
||||
image_url, headers=headers, timeout=timeout, proxies=proxies)
|
||||
while response.status_code != 200 and repair_count <= 5:
|
||||
time.sleep(3)
|
||||
download_image(image_url,dst_dir,file_name)
|
||||
ntfy.sendMsg(f'重试:第{repair_count}次 {image_url}')
|
||||
repair_count += 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user