v14 Notifier for SABNzbd
#1
Hello I made an script in python to notify KODI (or xbmc) the download has finished (shame it isnt in SABNzb as a standard)

Hope someone has a use for it or have remarks on it.

U have to place your own IP adres to kodi in the python script.

Give it a name like kodi.py and put the script in the script folder of sabnzbd ie: C:\Program Files (x86)\SABnzbd\scripts (for win 7)
Then go to config of SABNzbd and select the script in the que or at the categories as script (should apear in the drop down)

Code:
#!/usr/bin/python
__author__ = 'Richard van Soest'
from urllib.request import urlopen
from urllib.request import Request
from urllib.parse import unquote #not used
from urllib.parse import urlparse #not used
import sys
import json
import urllib

total = len(sys.argv)
cmdargs = str(sys.argv)

# for debugging only
#print ("The total numbers of args passed to the script: %d " % total)
#print ("Args list: %s " % cmdargs)
##Pharsing args one by one
#print ("Script name: %s" % str(sys.argv[0]))
#print ("First argument: %s" % str(sys.argv[1]))
#print ("Second argument: %s" % str(sys.argv[2]))
#print ("Third argument: %s" % str(sys.argv[3]))
#print ("Fourth argument: %s" % str(sys.argv[4]))
#print ("Fifth argument: %s" % str(sys.argv[5]))
#print ("Sixth argument: %s" % str(sys.argv[6]))
#print ("Seventh argument: %s" % str(sys.argv[7]))
#print ("----------------------")

sentence = sys.argv[3]

new = sentence.replace(" ", "%20")

#next line has to be in ONE line!!!
url = 'http://192.168.2.4/jsonrpc?request={%22jsonrpc%22:%222.0%22,%22method%22:%22GUI.ShowNotification%22,%22params%22:{%22displaytime%22:10000,%22title%22:%22SABNzbd%22,%22message%22:%22Finished%20'+new+'%22,%22image%22:%22http://sabnzbd.org/icon/sab2_512.png%22},%22id%22:1}'
response_stream = urlopen(url)

json_response = response_stream.read()


Questions, just ask.
Reply

Logout Mark Read Team Forum Stats Members Help
Notifier for SABNzbd0