Page 6 of 8

Re: XBMC Library Updater

Posted: October 6th, 2011, 5:11 pm
by JohnSCS
The HTTP API will be fully depreciated in Eden. Should still be working in Dharma. I can't remember my exact version, but it's Live 10.1 and not a nightly build.
Is this a fresh install and have you had the script working in the past?

Re: XBMC Library Updater

Posted: October 25th, 2011, 4:58 pm
by Ashex
I haven't used it in the past, I was using xbmc-send before to do updates. This isn't exactly a fresh install but I haven't really tweaked it much since installing it.

I did sort out the jsonrpc script, here it is:

Code: Select all

#!/usr/bin/python
import jsonrpclib
server = jsonrpclib.Server('http://localhost:8080/jsonrpc')
server.VideoLibrary.ScanForContent()

That's pretty much it, you can add in a bit to send a notification when it runs with another jsonrpc call or do pretty much anything.

you need to install the library of course.

Re: XBMC Library Updater

Posted: November 4th, 2011, 1:31 am
by jadel
Hi guys,

Trying to get the libary update working on my setup. ATV1 (crystalbuntu [ubuntu 8.04]) and pre eden XBMC. I think the last post from Ashex is for pre eden builds but I just have no idea what to do with it.

I read through the whole thread and cant really figure it out. I think most of the scripts are for win 7 yeah?

Anyway any help would be appreciated.

Thanks

Re: XBMC Library Updater

Posted: November 4th, 2011, 1:23 pm
by Ashex
If you want to use my python script, stick it in a file and name it xbmcupdate.py, don't forget to install the python library (look at the link in my previous post).

Grant it execute permissions (chmod +x xbmcupdate.py) then drop it in the scripts folder. Once you have done that you'll need to go in to sabnzbd+ and set that script for post-processing.

Re: XBMC Library Updater

Posted: November 13th, 2011, 11:41 pm
by RedsGT
jadel wrote:Hi guys,

Trying to get the libary update working on my setup. ATV1 (crystalbuntu [ubuntu 8.04]) and pre eden XBMC. I think the last post from Ashex is for pre eden builds but I just have no idea what to do with it.

I read through the whole thread and cant really figure it out. I think most of the scripts are for win 7 yeah?

Anyway any help would be appreciated.

Thanks
I don't know if this is your only problem, but if you're using an up to date pre Eden nightly, Ashex code needs to be changed to:

Code: Select all

#!/usr/bin/python
import jsonrpclib
server = jsonrpclib.Server('http://localhost:8080/jsonrpc')
server.VideoLibrary.Scan()
With this small piece of code you also need to make sure you have this : http://pypi.python.org/pypi/jsonrpclib on top of Python and of course make sure you don't have a password set, because this doesn't handle usernames/passwords.

Re: XBMC Library Updater

Posted: December 29th, 2011, 9:34 am
by CapnBry
You can do this without using python classes with just wget:

Code: Select all

wget -q -O/dev/null --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "VideoLibrary.Scan"}' http://localhost:8000/jsonrpc
If you want to see the response, use -O- and add "id": "anything" to the end of the JSON POST data. Tested on Eden 11.0 Beta 1. Also note that my XBMC HTTP server is on port 8000, modify if necessary.

Re: XBMC Library Updater

Posted: January 7th, 2012, 6:28 pm
by premiso
CapnBry: Thanks for that, works a treat!

Re: XBMC Library Updater

Posted: January 20th, 2012, 6:11 am
by Hitcher
CapnBry wrote:You can do this without using python classes with just wget:

Code: Select all

wget -q -O/dev/null --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "VideoLibrary.Scan"}' http://localhost:8000/jsonrpc
If you want to see the response, use -O- and add "id": "anything" to the end of the JSON POST data. Tested on Eden 11.0 Beta 1. Also note that my XBMC HTTP server is on port 8000, modify if necessary.
I've tested this using ssh and it works great but I can't get it to work in SABnzbd.

I've saved it to the scripts folder as xbmcupdate.py and made sure it's executable but SABnzbd throws up this error -

Code: Select all

Cannot run script /storage/.xbmc/userdata/addon_data/service.downloadmanager.SABnzbd-Suite/scripts/xbmcupdate.py
Any help appreciated.

Re: XBMC Library Updater

Posted: January 20th, 2012, 9:06 am
by RedsGT
It's not python, that's why it won't work. Someone will tell me if I'm wrong, but you probably should save it as a bash script.

Re: XBMC Library Updater

Posted: January 20th, 2012, 10:18 am
by Hitcher
Got there in the end using this -

Code: Select all

#!/usr/bin/python

import urllib
urllib.urlopen("http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))").close()
saved as xbmcupdate.py and made executable.

Re: XBMC Library Updater

Posted: January 23rd, 2012, 2:11 pm
by Hitcher
And now it's not working. :(

Anyone got a script that works for Eden?

Thanks.

Re: XBMC Library Updater

Posted: January 23rd, 2012, 2:21 pm
by RedsGT
Did beta 2 break it? Does the wget method still work for you?

Re: XBMC Library Updater

Posted: January 23rd, 2012, 2:42 pm
by Hitcher
I don't know how I should be saving the wget method?

Re: XBMC Library Updater

Posted: January 23rd, 2012, 2:50 pm
by RedsGT
I'm really rusty on my Linux skills but I think as a .sh file? With a "#!/bin/sh" header.

Re: XBMC Library Updater

Posted: January 23rd, 2012, 3:54 pm
by Hitcher
RedsGT wrote:I'm really rusty on my Linux skills but I think as a .sh file? With a "#!/bin/sh" header.
It was the header that I didn't have and now it's working.

Many thanks.