diff --git a/utils/entity/RouMan.py b/utils/entity/RouMan.py index 13658b1..dd64915 100644 --- a/utils/entity/RouMan.py +++ b/utils/entity/RouMan.py @@ -154,6 +154,26 @@ class comicEntity: @classmethod def comicChapterDownload(cls,chapter_url): + #验证数据是已存在且是否完整 + cbz_path = comicInfo.getDirCBZComicChapter()+".CBZ" + is_next = True + if os.path.exists(cbz_path): + try: + cbz_size = len(CBZUtils.zip_info(cbz_path)) - 1 + except: + cbz_size = 0 + if len(list_img) == cbz_size: + ntfy.sendMsg(f"{bookName} {chapterName} 数据完整,已跳过") + is_next = False + else: + ntfy.sendMsg(f"{bookName} {chapterName} 数据不完整,尝试删除配置CBZ文件后重试") + htmlUtils.remove_HtmlCache(chapter_url) + try: + ntfy.sendMsg(f"删除 {cbz_path}") + os.remove(cbz_path) + except: + ntfy(f"删除失败 {cbz_path}") + x = cls.baseComicData(chapter_url) bookName = x.get("bookName") chapterName = x.get("chapterName") @@ -212,24 +232,7 @@ class comicEntity: comicInfo.setChapterImgs(list_img) #保存图像 comicInfo.nextSaveInfoChapter(chapterName, list_img) - #验证数据是已存在且是否完整 - cbz_path = comicInfo.getDirCBZComicChapter()+".CBZ" - is_next = True - if os.path.exists(cbz_path): - try: - cbz_size = len(CBZUtils.zip_info(cbz_path)) - 1 - except: - cbz_size = 0 - if len(list_img) == cbz_size: - ntfy.sendMsg(f"{bookName} {chapterName} 数据完整,已跳过") - is_next = False - else: - ntfy.sendMsg(f"{bookName} {chapterName} 数据不完整,尝试删除配置CBZ文件后重试") - try: - ntfy.sendMsg(f"删除 {cbz_path}") - os.remove(cbz_path) - except: - ntfy(f"删除失败 {cbz_path}") + if is_next: ntfy.sendMsg(f"{bookName} {chapterName} 下载中") download_images(list_img,comicInfo.getDirComicChapter(), filesName=list_fileName)