Thread Rating:
  • 1 Vote(s) - 5 Average
[WINDOWS] HOW-TO schedule automatic library updates
Pr.Sinister Wrote:Well since using Sick Beard, i have discontinued using my auto-update hack but i just noticed yesterday in the XBMC add-ons directory something called XBMC Library Auto-Update. It seems to be a very easy way to do what you need.


w00t thanks mate!
Although it would be much nicer if it were possible to schedule at certain times instead of every 2-x hours but this is still good Smile.
I am having a bit of trouble getting this new Add-on to work.
In the Description page for this add-on, it says that you need to manually start the timer each time you start XBMC, or move the supplied to your userdata directory to get it to start automatically. I have looked for the file (supplied by the add-on) buy can't find it

What am I doing wrong?
Hi all

I cannot get my advancedsettings.xml to work. I just want XBMC to remove the titles in the library that i have deleted on my share. I don't need the other settings. I have made a advancedsettings.xml file and placed in xbmc/userdata

It looks like this.
<cleanonupdate>true</cleanonupdate> <!-- default set to false to prevent xbmc from removing items from the database while updating -->

But it just doesnt remove movies from the library, can anyone help?
Quote:Originally Posted by queeup
I prefer built-in schedule function for this.

In my experience, that plugin is not reliable.

I've used it on multiple machines and it always stops working after 1 or 2 updates, or will only update when XBMC is not idle.

But maybe it's just me.
I use a similar method to update my library. Using windows task manager and a vbscript.

x = TextFromHTML("")

Function TextFromHTML(URL)
    set ie = createobject("internetexplorer.application")
    ie.navigate URL
    do until ie.readystate = 4 : wscript.sleep 10: loop
    TextFromHTML = ie.document.body.outerHtml
End Function
Save the above with a vbs extension and add as a scheduled task to execute as often as you want. Obviously you can edit the url to change IP or add username/password ie http://username:[email protected],168.1.5/xbmcCmds...............
Something I did was put this in a CMD script and have it run after you move your video to the right folder. In my case I have everything automated. Files get downloaded and then post processing happens and I included these 2 lines in that script.

You dont have to AutoIt to achieve the same thing.

"C:\Program Files\GnuWin32\bin\wget.exe" http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))
del "[email protected]=ExecBuiltIn(UpdateLibrary(video))"
If anyone else has been using this on their HTPC for so long that they forgot about it, here's the deal.
It no longer works with Frodo. The old HTTP API has been deprecated. You can update your script to something equally simple/strange by:

1. Downloading curl.exe. (For this example I put it at the C:\ root directory.)
2. Replace the autoIt au3 code with
;Run("E:\XBMC Mod Files\wget.exe http://xbmc:[email protected]:8081/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))", "", "")

Run("C:\curl.exe -H ""Content-Type: application/json"" -X POST http://xbmc:[email protected]:8081/jsonrpc -d ""{\""jsonrpc\"": \""2.0\"", \""method\"": \""VideoLibrary.Scan\"", \""params\"": { \""directory\"": \""\"" }, \""id\"": 1}""")

This can be verified via the XBMC JSON RPC Documentation where there are calls to do much more than just re-scan the video library.

If you want to avoid downloading anything you can just run a powershell script.

$username = ''
$pwd = ''
$hostname = 'ip or hostname'
$port = ''
$jsonmethod = 'VideoLibrary.Scan'
$secpwd = ConvertTo-SecureString $pwd -AsPlainText -Force
$json = '{"jsonrpc":"2.0","id":1,"method":"'+$jsonmethod+'"}'
$url = 'http://'+$hostname+':'+$port+'/jsonrpc'
$mycreds = New-Object System.Management.Automation.PSCredential ($username, $secpwd)
$webreq = Invoke-WebRequest -Uri $url -Credential $mycreds -Body $json -ContentType application/json -Method POST

[WINDOWS] HOW-TO schedule automatic library updates51