Updating library from command line

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Bommy Offline
Junior Member
Posts: 38
Joined: Oct 2004
Reputation: 0
Post: #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
find quote
ccMatrix Offline
Alaska Group
Posts: 470
Joined: Oct 2008
Post: #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.
find quote
Bommy Offline
Junior Member
Posts: 38
Joined: Oct 2004
Reputation: 0
Post: #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
find quote
keithskaggs Offline
Member
Posts: 65
Joined: Feb 2008
Reputation: 0
Post: #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
find quote
Bommy Offline
Junior Member
Posts: 38
Joined: Oct 2004
Reputation: 0
Post: #5
Brilliant, thanks Keith.
find quote
Bommy Offline
Junior Member
Posts: 38
Joined: Oct 2004
Reputation: 0
Post: #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?
find quote
keithskaggs Offline
Member
Posts: 65
Joined: Feb 2008
Reputation: 0
Post: #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
find quote
Abe Froman Offline
Senior Member
Posts: 163
Joined: Apr 2010
Reputation: 7
Post: #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....
find quote
FishOil Offline
Posting Freak
Posts: 991
Joined: May 2009
Reputation: 14
Post: #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)
(This post was last modified: 2011-04-26 10:18 by FishOil.)
find quote
keithskaggs Offline
Member
Posts: 65
Joined: Feb 2008
Reputation: 0
Post: #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
find quote
Abe Froman Offline
Senior Member
Posts: 163
Joined: Apr 2010
Reputation: 7
Post: #11
Thanks I ended up using the auto-update plugin within XBMC to pull rather than push the update.
find quote
pacific88 Offline
Junior Member
Posts: 10
Joined: Mar 2010
Reputation: 0
Post: #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)
(This post was last modified: 2012-02-22 05:02 by pacific88.)
find quote
idarkside Offline
Junior Member
Posts: 1
Joined: Jul 2012
Reputation: 0
Post: #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
(This post was last modified: 2012-07-03 00:58 by idarkside.)
find quote