mirror of
https://github.com/unixtensor/proxmox-ntfy.git
synced 2025-06-28 13:08:05 +00:00
Use requests
module instead of curl and use python3 main.py server.com
instead of --server=server.com
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
class Ntfy:
|
||||
def __init__(self, server: str):
|
||||
@ -6,6 +6,6 @@ class Ntfy:
|
||||
|
||||
def send(self, message: str):
|
||||
try:
|
||||
subprocess.run(["curl", "-d", f"\"{message}\"", self.server], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
requests.post(self.server, data=message)
|
||||
except Exception as err:
|
||||
print(f"Ntfy failed. {err}")
|
||||
|
Reference in New Issue
Block a user