From 2d84a289c81ce23c8014301bdc822d18962a3abe Mon Sep 17 00:00:00 2001 From: hours <871214098@qq.com> Date: Mon, 15 Aug 2022 20:11:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0gotifiy=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/push.ini.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/push.ini.example b/config/push.ini.example index 466eba4..c512f39 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -35,3 +35,7 @@ secret= [bark] api_url=https://api.day.app token=ssXXX + +[gotify] +api_url=http://xxx.xxx.cn +token=AMxxxx From 6160202339b6d8b0c53ac9b6a2e368320cd75382 Mon Sep 17 00:00:00 2001 From: hours <871214098@qq.com> Date: Mon, 15 Aug 2022 20:12:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E5=88=B0gotify=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- push.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/push.py b/push.py index 25b831a..0483f26 100644 --- a/push.py +++ b/push.py @@ -144,6 +144,18 @@ def bark(status, push_message): ).json() log.info(f"推送结果:{rep.get('message')}") +# gotify +def gotify(status, push_message): + rep = http.post( + url=f'{cfg.get("gotify", "api_url")}/message?token={cfg.get("gotify", "token")}', + headers={"Content-Type": "application/json; charset=utf-8"}, + json={ + "title": title(status), + "message": push_message + } + ).json() + log.info(f"推送结果:{rep.get('errmsg')}") + def push(status, push_message): if not load_config(): return 0