This commit is contained in:
caiwx86 2022-12-22 14:02:20 +08:00
parent e9875d34e8
commit 69a3a75808

View File

@ -154,26 +154,6 @@ 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")
@ -203,8 +183,8 @@ class comicEntity:
except:
htmlUtils.remove_HtmlCache(chapter_url)
htmlUtils.remove_HtmlCache(chapterAPIUrl)
ntfy.sendMsg("存在错误,请退出后尝试")
exit()
ntfy.sendMsg("存在错误,尝试")
cls.comicChapterDownload(chapter_url)
if images == None:
ntfy.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")
@ -232,7 +212,25 @@ 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文件后重试")
htmlUtils.remove_HtmlCache(chapter_url)
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)