Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #
- # Change token, user and device. Device can be skipped (notification will be sent to all devices
- import httplib, urllib, sys, syslog
- syslog.syslog('deluge test: the script started running')
- if len(sys.argv) != 4:
- syslog.syslog("Not 4 input arguments")
- sys.exit(0)
- torrent_name = sys.argv[2]
- folder = sys.argv[3]
- title = 'Torrent Downloaded'
- conn = httplib.HTTPSConnection("api.pushover.net:443")
- conn.request("POST", "/1/messages.json",
- urllib.urlencode({
- "token": "<application_token>",
- "user": "<user_token>",
- "message": torrent_name,
- "title": title,
- "device": "<device_name>",
- }), { "Content-type": "application/x-www-form-urlencoded" })
- conn.getresponse()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement