From ca955ed9ed2eebb3ca9212023535e3ada45571d0 Mon Sep 17 00:00:00 2001 From: murmur Date: Sat, 25 Mar 2023 17:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=87=E7=94=A8push?= =?UTF-8?q?=E7=AB=99=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 1d75d30..96b22fa 100755 --- a/server.py +++ b/server.py @@ -56,11 +56,27 @@ _{datetime.datetime.now()}_ pushisbusy=1 def send(): c= " \n".join(msgcache[:3]) - requests.post("http://push.nmhd.eu.org:12722/push/murmur", json={ + res = requests.post("http://push.nmhd.eu.org:12722/push/murmur", json={ "title": title, "description": description, "content": c, "token": "tt"}) + # print(res) + try: + res = res.json()["success"] + except: + s="https://msgpusher.com/push/test111" + # s="http://47.108.213.155:11722/push/murmur" + res = requests.post(s, json={ + "title": title, + "description": description, + "content": c, + "token": "tt"}) + # else: + # if res["success"]: + # return None + # else: + # return res["message"] if len(msgcache) >3: send()