From 96ce88c0eb67d686d417e6de852d2a6d21e83ff8 Mon Sep 17 00:00:00 2001 From: cwx Date: Fri, 9 Dec 2022 21:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=95=E8=8E=B7=E5=BC=82=E5=B8=B8=E5=B9=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/entity/RouMan.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) 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)