fix
This commit is contained in:
parent
02455f96d8
commit
e0ebedb95a
@ -36,7 +36,17 @@ class htmlUtils:
|
||||
os.makedirs(dir_name)
|
||||
with open(file_path,"w",encoding="utf-8") as fs:
|
||||
fs.write(str(data))
|
||||
|
||||
|
||||
@classmethod
|
||||
def remove_HtmlCache(cls,url):
|
||||
file_path = cls.getPathSaveHtml(url,type="new")
|
||||
if os.path.exists(file_path):
|
||||
try:
|
||||
os.remove(file_path)
|
||||
print("已删除")
|
||||
except:
|
||||
print()
|
||||
|
||||
@classmethod
|
||||
def getHTML(cls, curl,type=None):
|
||||
retries = Retry(total=3,
|
||||
|
||||
@ -175,10 +175,15 @@ class comicEntity:
|
||||
if chapterAPIPath != None:
|
||||
base_url = comicInfo.getBaseUrl(chapter_url)
|
||||
chapterAPIUrl = base_url+chapterAPIPath
|
||||
data = json.loads(htmlUtils.getJSON(chapterAPIUrl))
|
||||
data = data.get("chapter")
|
||||
chapterName = data.get("name")
|
||||
images = data.get("images")
|
||||
try:
|
||||
data = htmlUtils.getJSON(chapterAPIUrl)
|
||||
data = data.get("chapter")
|
||||
chapterName = data.get("name")
|
||||
images = data.get("images")
|
||||
except:
|
||||
htmlUtils.remove_HtmlCache(chapterAPIUrl)
|
||||
ntfy.sendMsg("存在错误,请退出后尝试")
|
||||
exit()
|
||||
if images == None:
|
||||
ntfy.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user