Post Processing script for Sabnzbd running to update & clean the video library
#1
Hi Guys,

Been using this code snippet for ages as part of my post processing script under Sabnzbd on linux for updating & then cleaning the video library after every new TV show download. (Sabnzbd runs on my XBMC HTPC)

Code:
echo "Updating XBMC Video Library..."
/usr/bin/sudo -u lee -H curl 'http://10.0.0.27:8081/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)'
/bin/sleep 30
echo "Cleaning XBMC Video Library..."
/usr/bin/sudo -u lee -H curl 'http://10.0.0.27:8081/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.cleanlibrary(video)'

In this example 'lee' is my username and note that I run the XBMC webserver on port 8081 so it does not clash with Sabnzbd's own web server component. (Don't forget to change the server IP too to suit your needs.)

I think there is a Windows port of curl so there is no reason why this basic script couldn't be modified to work under windows using curl.

Hope this helps someone out.
Reply
#2
Awesome ill give it a go!
One question, what is the extension of the script?
for example:
Updatelib.*

Thanks

Drew
Acer Revo 1600 2Gb ram OpenELEC Eden Nighlies. SABnzbd + Sickbeard + CouchPotato Addons
Synology DS210j Soon to be Retired
HP ProLiant N40L
Reply
#3
The filename is not important but it must be made executable under linux

e.g. if you created a bash script called updatelib.sh then you would do the following to make it executable
Code:
chmod 755 updatelib.sh
Reply
#4
updatelib.sh contents:
Code:
Updating XBMC Video Library..."
/usr/bin/sudo -u xbmc -H curl 'http://192.168.2.104:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)'

Error output:
Quote:./updatelib.sh
Updating XBMC Video Library...
./updatelib.sh: ./updatelib.sh: 2: /usr/bin/sudo: not found

Xbmc Live Dharma Beta 2

Drew
Acer Revo 1600 2Gb ram OpenELEC Eden Nighlies. SABnzbd + Sickbeard + CouchPotato Addons
Synology DS210j Soon to be Retired
HP ProLiant N40L
Reply
#5
Im also looking for an way to get this working in dharma. They are now using json instead. Posted an question but have not got any anwser back yet. Check out

http://forum.xbmc.org/showthread.php?p=6...post608192
Post: 327

Maby if we wait to the stable relase, some friendly coder will help =)
---------------------------------------------------
Intel NUC Haswell D34010WYK | ATV2 | Logitech Harmony One | Onkyo TX-NR808 Receiver | QNAP 809 | APC Back-UPS RS 550
Reply
#6
The script works in XBMC camelot. I'm guessing if you are running the new Dharma build it may fail if the devs have significantly changed how the webserver works which I suspect may be the case. I don't know as I have not used Dharma yet, I am waiting for the final release before I try.

As for the sudo error encountered by an earlier poster, it's because you do not have the sudo package installed.

One other thing I didn't mention. Don't forget to put the following as the first line of your bash script.

Code:
#!/bin/bash

Apologies, I made too many assumptions on this when I should have been a lot more specific as to what to do.
Reply

Logout Mark Read Team Forum Stats Members Help
Post Processing script for Sabnzbd running to update & clean the video library0