Use requests module instead of curl and use python3 main.py server.com instead of --server=server.com

This commit is contained in:
2025-06-06 14:20:23 -04:00
parent 32f60194d0
commit cacc1b827f
4 changed files with 20 additions and 18 deletions

View File

@ -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}")