|
|
|
@ -11,7 +11,7 @@ def get_args():
|
|
|
|
|
parser.add_argument('--url', type=str, help='Supplementary URL to show with your message')
|
|
|
|
|
parser.add_argument('--url_title', type=str, help='title for your supplementary URL, otherwise just the URL is shown')
|
|
|
|
|
parser.add_argument('--device', type=str, help='Device name to send the message directly to')
|
|
|
|
|
parser.add_argument('--priority', type=str, help='Notification priority (low-to-high: -2 to 1)')
|
|
|
|
|
parser.add_argument('--priority', type=int, help='Notification priority (low-to-high: -2 to 1)')
|
|
|
|
|
parser.add_argument('--sound', type=str, help='The name of a supported sound (https://pushover.net/api#sounds; custom sounds are supported)')
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
return args
|
|
|
|
@ -27,7 +27,7 @@ def main():
|
|
|
|
|
url: str | None = args.url if args.url else None
|
|
|
|
|
url_title: str | None = args.url_title if args.url_title else None
|
|
|
|
|
device: str | None = args.device if args.device else None
|
|
|
|
|
priority: str | None = args.priority if args.priority else None
|
|
|
|
|
priority: int | None = args.priority if args.priority else None
|
|
|
|
|
sound: str | None = args.sound if args.sound else None
|
|
|
|
|
|
|
|
|
|
if not msg:
|
|
|
|
@ -52,6 +52,11 @@ def main():
|
|
|
|
|
if sound:
|
|
|
|
|
payload['sound'] = sound
|
|
|
|
|
|
|
|
|
|
_printable_payload = payload.copy()
|
|
|
|
|
_printable_payload['token'] = '***'
|
|
|
|
|
_printable_payload['user'] = '***'
|
|
|
|
|
print(_printable_payload)
|
|
|
|
|
|
|
|
|
|
response = requests.post(
|
|
|
|
|
url='https://api.pushover.net/1/messages.json',
|
|
|
|
|
headers={'Content-Type': 'application/x-www-form-urlencoded'},
|
|
|
|
|