Updating library from command line
#1
I'm no programmer by any stretch so have no real ideas about scripts and python and all that jazz. What I have done is set up a simple .cmd file that moves my files about and runs theRenamer. All it's lacking is the ability to notify XBMC that it's run so that it updates the library each time - doing it each time XBMC runs isn't good enough as I'm aiming to leave it running all the time, just putting the system into hibernate when not in use.

Would anyone be so kind as to outline the simplest way to get my .cmd file to achieve this? Windows 7 is the OS I'm using.

I think this is the last step in my very simple automated system so I'll be posting a guide to how I've done it once it's all dealt with Smile
Reply
#2
You could use an application like curl.exe or wget.exe to access the web interface of your XBMC installation and execute the built in function UpdateLibrary. See http://wiki.xbmc.org/index.php?title=Web...r_HTTP_API and http://wiki.xbmc.org/index.php?title=Lis..._Functions for some details.
Reply
#3
OK cool, will try and get my head around that. Thank you.

So is this the way that anyone with an automated system tells XBMC to update the library from outside of the program - via the web interface? Seems like a bit of a hack but I guess it's not really, and as long as it works, who cares? Smile
Reply
#4
I have a batch file that I run as a scheduled task on Win 7 32bit. The task runs every 10 minutes and uses the Windows version of WGET (available here http://users.ugent.be/~bpuype/wget/.)

The batch file contains the following:

wget -q "http://xbmcpc/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"

del *.updatelibrary(video) /q

exit


That's how I do it, hope that helps.

Keith
Reply
#5
Brilliant, thanks Keith.
Reply
#6
Sorry, not got round to trying this yet, but two questions...

1 - Do I replace xbmcpc with my IP address?
2 - What does the second line, starting del, do?
Reply
#7
Quote:1 - Do I replace xbmcpc with my IP address?
2 - What does the second line, starting del, do?

1. Yes
2. I really don't know. I copied the three lines from an example a year or so ago and I can't recall why it's there.

Keith
Reply
#8
keithskaggs Wrote:I have a batch file that I run as a scheduled task on Win 7 32bit. The task runs every 10 minutes and uses the Windows version of WGET (available here http://users.ugent.be/~bpuype/wget/.)

The batch file contains the following:

wget -q "http://xbmcpc/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)"

del *.updatelibrary(video) /q

exit


That's how I do it, hope that helps.

Keith


Does this work on Dharma? The comman returns OK but the library does not seem to update and there is nothing showing in the log....
Reply
#9
Abe Froman Wrote:Does this work on Dharma? The comman returns OK but the library does not seem to update and there is nothing showing in the log....


I do it from a browser

Code:
http://XBMC.ip.address:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)
Reply
#10
I am using Beta 3 now, and it is still working as far as I know. I use "The Renamer" and Grabit on a seperate computer. I set the downloads in the morning and when I return from work XBMC has the new shows ready to view. I upgraded to Dharma Beta 3 on Sunday and have had no problems with the library udate using the method I outlined earlier.

Keith
Reply
#11
Thanks I ended up using the auto-update plugin within XBMC to pull rather than push the update.
Reply
#12
thanks for that. i also discovered after an update, you can clean the library with this:

Code:
http://xbmcipaddress:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.cleanlibrary(video)
Reply
#13
hi there id just like to clear a few things up Smile

the "wget -q "http://USERNAME:PASSWORD@XBMCPC:XBMCPORT/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)" - connects to the xbmc machine and loads, downloads and saves the page which in turn will set the update going

the
del "*.updatelibrary(video) /q" command deletes the saved page that has just taken place

and the "exit" command closes the command session

PS tested and working with eden

thanks Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Updating library from command line0