diff --git a/utils/entity/RouMan.py b/utils/entity/RouMan.py index fcf9f34..3df7e0a 100644 --- a/utils/entity/RouMan.py +++ b/utils/entity/RouMan.py @@ -85,20 +85,26 @@ class comicEntity: ''' @classmethod def comicChapter(cls,chapter_url,scramble=None,sleep=None): - cls.Onechapter(chapter_url,scramble) - #进入下个阶段 - if comicInfo.nextExistsGetPath("down_"): + try: + cls.Onechapter(chapter_url,scramble) + #进入下个阶段 + if comicInfo.nextExistsGetPath("down_"): #章节图片全部下载后,调用下载封面 - netUtils.downloadComicIcon() - #下个阶段 - if comicInfo.nextExistsGetPath("cbz_"): - time.sleep(1) + netUtils.downloadComicIcon() + #下个阶段 + if comicInfo.nextExistsGetPath("cbz_"): + time.sleep(1) #下载后自动打包 - CBZUtils.packAutoComicChapterCBZ() + CBZUtils.packAutoComicChapterCBZ() #完成删除原文件 - remove_path = comicInfo.getDirComicChapter() - shutil.rmtree(remove_path) - print(f"文件已删除: {remove_path}") + remove_path = comicInfo.getDirComicChapter() + shutil.rmtree(remove_path) + print(f"文件已删除: {remove_path}") + except: + dirComicChapter = comicInfo.getDirComicChapter + if not dirComicChapter == None and os.path.exists(dirComicChapter): + shutil.rmtree(dirComicChapter) + cls.comicChapter(chapter_url,scramble,sleep) if not sleep == None: print(f"{sleep} 秒后开始下载下一个章节") time.sleep(sleep)