From 33121ce9608df17d18c8ddad14c95b169acc8c0f Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Thu, 22 Dec 2022 14:07:21 +0800 Subject: [PATCH] fix --- utils/entity/RouMan.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/utils/entity/RouMan.py b/utils/entity/RouMan.py index 04fcb3c..7832c4c 100644 --- a/utils/entity/RouMan.py +++ b/utils/entity/RouMan.py @@ -136,7 +136,10 @@ class comicEntity: def Onechapter(cls,chapter_url,scramble=None): if not str(chapter_url).startswith("http"): chapter_url = comicInfo.getBaseUrl() + chapter_url - is_next = cls.comicChapterDownload(chapter_url) + try: + is_next = cls.comicChapterDownload(chapter_url) + except: + is_next = cls.comicChapterDownload(chapter_url,True) comicInfo.nextInfoToImgChapter() #下载完成后, 开始解密图片 if scramble: @@ -153,8 +156,8 @@ class comicEntity: return is_next @classmethod - def comicChapterDownload(cls,chapter_url): - x = cls.baseComicData(chapter_url) + def comicChapterDownload(cls,chapter_url,update): + x = cls.baseComicData(chapter_url,update) bookName = x.get("bookName") chapterName = x.get("chapterName") #fileUtils.saveConfComicChapterInfo(chapterName,x,bookName) @@ -175,16 +178,10 @@ class comicEntity: if chapterAPIPath != None: base_url = comicInfo.getBaseUrl(chapter_url) chapterAPIUrl = base_url+chapterAPIPath - try: - data = htmlUtils.getJSON(chapterAPIUrl) - data = data.get("chapter") - chapterName = data.get("name") - images = data.get("images") - except: - htmlUtils.remove_HtmlCache(chapter_url) - htmlUtils.remove_HtmlCache(chapterAPIUrl) - ntfy.sendMsg("存在错误,尝试中") - cls.comicChapterDownload(chapter_url) + data = htmlUtils.getJSON(chapterAPIUrl) + data = data.get("chapter") + chapterName = data.get("name") + images = data.get("images") if images == None: ntfy.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")