From 9fd9c65a72de179473e4e65300f5529d7f312957 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Mon, 9 Jan 2023 20:26:08 +0800 Subject: [PATCH] fix --- utils/Ntfy.py | 7 ++++--- utils/entity/RouMan.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/Ntfy.py b/utils/Ntfy.py index 08b6f66..0a26d77 100644 --- a/utils/Ntfy.py +++ b/utils/Ntfy.py @@ -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}") \ No newline at end of file diff --git a/utils/entity/RouMan.py b/utils/entity/RouMan.py index 32b00aa..7302fd0 100644 --- a/utils/entity/RouMan.py +++ b/utils/entity/RouMan.py @@ -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")