This commit is contained in:
caiwx86 2023-01-09 20:26:08 +08:00
parent 368538e980
commit 9fd9c65a72
2 changed files with 5 additions and 4 deletions

View File

@ -2,10 +2,11 @@ import requests
class ntfy:
@classmethod
def sendMsg(cls, msg):
def sendMsg(cls, msg,alert=True):
try:
print(f"#ntfy: {msg}")
requests.post("https://ntfy.caiwenxiu.cn/PyComic",
data=msg.encode(encoding='utf-8'))
if alert:
requests.post("https://ntfy.caiwenxiu.cn/PyComic",
data=msg.encode(encoding='utf-8'))
except:
print(f"#ntfy error: {msg}")

View File

@ -178,7 +178,7 @@ class comicEntity:
chapterAPIPath = str(chapterAPIPath).encode('utf-8').decode('unicode_escape')
base_url = comicInfo.getBaseUrl(chapter_url)
chapterAPIUrl = base_url+chapterAPIPath
ntfy.sendMsg(f"chapterApiUrl= {chapterAPIUrl}")
ntfy.sendMsg(f"chapterApiUrl= {chapterAPIUrl}",alert=False)
data = htmlUtils.getJSON(chapterAPIUrl)
if data != None:
data = data.get("chapter")