Updating library from command line - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Kodi General Help and Support (/forumdisplay.php?fid=111)
+---- Forum: Windows support (/forumdisplay.php?fid=59)
+---- Thread: Updating library from command line (/showthread.php?tid=82452)
Updating library from command line - Bommy - 2010-10-03 21:35
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
- ccMatrix - 2010-10-03 22:04
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_Server_HTTP_API and http://wiki.xbmc.org/index.php?title=List_of_Built_In_Functions for some details.
- Bommy - 2010-10-04 00:45
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?
- keithskaggs - 2010-10-04 01:30
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¶meter=XBMC.updatelibrary(video)"
del *.updatelibrary(video) /q
That's how I do it, hope that helps.
- Bommy - 2010-10-04 11:38
Brilliant, thanks Keith.
- Bommy - 2010-10-05 00:41
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?
- keithskaggs - 2010-10-05 02:51
Quote:1 - Do I replace xbmcpc with my IP address?
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.
- Abe Froman - 2010-10-09 16:25
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/.)
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....
- FishOil - 2010-10-20 06:24
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
- keithskaggs - 2010-10-20 10:35
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.
- Abe Froman - 2010-10-20 17:22
Thanks I ended up using the auto-update plugin within XBMC to pull rather than push the update.
- pacific88 - 2012-02-22 04:59
thanks for that. i also discovered after an update, you can clean the library with this:
RE: Updating library from command line - idarkside - 2012-07-03 00:57
hi there id just like to clear a few things up
the "wget -q "http://USERNAME:PASSWORD@XBMCPC:XBMCPORT/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)" - connects to the xbmc machine and loads, downloads and saves the page which in turn will set the update going
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