From f99b37a66b1331fea792d486bfda770687c36972 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Mon, 9 Jan 2023 21:07:28 +0800 Subject: [PATCH] fix --- utils/entity/RouMan.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/utils/entity/RouMan.py b/utils/entity/RouMan.py index a086203..caa43f2 100644 --- a/utils/entity/RouMan.py +++ b/utils/entity/RouMan.py @@ -235,11 +235,22 @@ class comicEntity: except: ntfy(f"删除失败 {cbz_path}") if is_next: - pathComicInfo = comicInfo.getPathComicInfoXML() - if not os.path.exists(pathComicInfo): + path_comic_info = comicInfo.getPathComicInfoXML() + if not os.path.exists(path_comic_info): #print("不存在ComicInfo.xml 生成中...") comicInfo.setPages(list_fileName) comicInfo.writeComicInfoXML(chapterName) ntfy.sendMsg(f"{bookName} {chapterName} 下载中") - download_images(list_img,comicInfo.getDirComicChapter(), filesName=list_fileName) + is_next = verUtils.verNextCBZ(list_img) + repeat = 0 + while not is_next or repeat <= 3: + download_images(list_img,comicInfo.getDirComicChapter(), filesName=list_fileName,timeout=180) + file_imgs = os.listdir(comicInfo.getDirComicChapter()) + count_jpg = ",".join(file_imgs).split(".jpg") + is_next = len(count_jpg)-1 == len(list_img) + if not is_next: + sleep_time = 3+int(repeat)*2 + time.sleep(sleep_time) + ntfy.sendMsg(f"下载数据({len(count_jpg)-1}/{len(list_img)})不完整,{sleep_time}秒钟后尝试第{repeat}次") + repeat += 1 return is_next \ No newline at end of file