This commit is contained in:
Data-Monkey
2023-06-09 08:44:50 +10:00
parent 55ed3c4ae0
commit 9d982eff1b
3 changed files with 14 additions and 5 deletions

View File

@@ -32,6 +32,12 @@ def send (msg: noti_struc):
# add authorization header with hash
headers["Authorization"] = "Basic {}".format(basichash)
requests.post("{}/{}".format( conf.NTFY_HOST, conf.NTFY_TOPIC),
data=msg.html,
headers=headers)
try:
requests.post("{}/{}".format( conf.NTFY_HOST, conf.NTFY_TOPIC),
data=msg.html,
headers=headers)
except requests.exceptions.RequestException as e:
mylog('none', ['[NTFY] Error: ', e])
return -1
return 0