Skip to content

Instantly share code, notes, and snippets.

@simonszu
Created June 16, 2015 17:46
Show Gist options
  • Select an option

  • Save simonszu/b8a62406fedc1f050472 to your computer and use it in GitHub Desktop.

Select an option

Save simonszu/b8a62406fedc1f050472 to your computer and use it in GitHub Desktop.
Sabnzbd prowl notify interface
#! /usr/bin/python
import sys,urllib
# Get clean NZB name
job_name = sys.argv[3]
# Prowl API settings - http://prowl.weks.net/api.php
# Set Prowl API
API = "0d1946d5026af97087954e84f4d45135d11f7241"
# Set Prowl priority. 0 - Normal, 2 - Emergency, -2 - Very Low
priority = "0"
# Set job title/event name
job_title = "Download%20Complete"
# Get current date/time and strip spaces
from time import gmtime, strftime
event_time = strftime("%d/%m/%y %H:%M")
event_time=event_time.replace(' ', '%20')
# URL encode chars from NZB name that cause issues
job_name=job_name.replace(' ', '%20')
job_name=job_name.replace('_', '%20')
job_name=job_name.replace('.', '%20')
# Send download complete notification to iPhone - swap 'job_title' for 'event_time' if completion time is required instead of 'Download Complete'
urllib.urlopen("https://prowl.weks.net/publicapi/add?apikey=" + API + "&priority=" + priority + "&application=SABnzbd&event=" + event_time + "&description=" + job_name)
#!/bin/bash
userkey="096FLLDYJStlNrSsv0jas4TVth5CeQ"
token="gCGLPM8p2AHcd7IQuvLWp4Kr4zrjN5"
job_title=$3
curl -s -F "token=$token" -F "user=$userkey" -F "message=Download Completed - $job_title" https://api.pushover.net/1/messages.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment