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) '''