fix
This commit is contained in:
1 parent
aee76e4ec4
commit
775c0c996f
2 files changed
+8
-5
No files matched your search
+4
-1
@@ -93,7 +93,10 @@ class htmlUtils:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def getJSON(cls,url):
|
def getJSON(cls,url):
|
||||||
url_text = requests.get(url,headers=cls.headers, timeout=180).text
|
url_text = requests.get(url,headers=cls.headers, timeout=180).text
|
||||||
return json.loads(url_text)
|
try:
|
||||||
|
return json.loads(url_text)
|
||||||
|
except:
|
||||||
|
return None
|
||||||
#return cls.getHTML(url,type="json")
|
#return cls.getHTML(url,type="json")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ class comicEntity:
|
|||||||
chapterAPIUrl = base_url+chapterAPIPath
|
chapterAPIUrl = base_url+chapterAPIPath
|
||||||
ntfy.sendMsg(f"chapterApiUrl= {chapterAPIUrl}")
|
ntfy.sendMsg(f"chapterApiUrl= {chapterAPIUrl}")
|
||||||
data = htmlUtils.getJSON(chapterAPIUrl)
|
data = htmlUtils.getJSON(chapterAPIUrl)
|
||||||
print(data)
|
if data != None:
|
||||||
data = data.get("chapter")
|
data = data.get("chapter")
|
||||||
chapterName = data.get("name")
|
chapterName = data.get("name")
|
||||||
images = data.get("images")
|
images = data.get("images")
|
||||||
if images == None:
|
if images == None:
|
||||||
ntfy.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")
|
ntfy.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user