This commit is contained in:
caiwx86 2022-12-18 12:36:03 +08:00
parent 815ad1f108
commit d1ca41de63
2 changed files with 2 additions and 1 deletions

View File

@ -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()

View File

@ -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