From 57db571e5d1591a96c3fb94be610eef1449a7fae Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Tue, 20 Dec 2022 17:35:04 +0800 Subject: [PATCH] fix --- utils/HtmlUtils.py | 6 +++--- utils/entity/RouMan.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/HtmlUtils.py b/utils/HtmlUtils.py index a542b81..d5456ed 100644 --- a/utils/HtmlUtils.py +++ b/utils/HtmlUtils.py @@ -61,10 +61,10 @@ class htmlUtils: url_text = res if type == "json": url_text = res.json() - else: + cls.saveHtml(curl,res.text) + if type == None: url_text = html.fromstring(res.text) - - cls.saveHtml(curl,res.text) + cls.saveHtml(curl,res.text) except: print(f'Retry! 第{count}次') time.sleep(3) diff --git a/utils/entity/RouMan.py b/utils/entity/RouMan.py index d15b0ea..0b06024 100644 --- a/utils/entity/RouMan.py +++ b/utils/entity/RouMan.py @@ -86,10 +86,10 @@ class comicEntity: cls.count_chapter += 1 #一本漫画下载后等待 #清空文件夹 - pathDirComic = comicInfo.getDirComic() - if os.path.exists(pathDirComic): - shutil.rmtree(pathDirComic) - if not sleep == None: + path_dir_comic = comicInfo.getDirComic() + if os.path.exists(path_dir_comic): + shutil.rmtree(path_dir_comic) + if sleep != None: time.sleep(sleep) '''