[WINDOWS] HOW-TO schedule automatic library updates

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
RhysG Offline
Junior Member
Posts: 13
Joined: Jun 2010
Reputation: 0
Post: #16
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.

-Pr.

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.
find quote
sossy Offline
Junior Member
Posts: 24
Joined: Nov 2009
Reputation: 0
Post: #17
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 autoexec.py to your userdata directory to get it to start automatically. I have looked for the autoexec.py file (supplied by the add-on) buy can't find it

What am I doing wrong?
(This post was last modified: 2010-11-04 02:36 by sossy.)
find quote
torstenk Offline
Junior Member
Posts: 7
Joined: Jan 2011
Reputation: 0
Post: #18
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.
<advancedsettings>
<videolibrary>
<cleanonupdate>true</cleanonupdate> <!-- default set to false to prevent xbmc from removing items from the database while updating -->
</videolibrary>
</advancedsettings>

But it just doesnt remove movies from the library, can anyone help?
find quote
ihaterich Offline
Member
Posts: 75
Joined: Jul 2010
Reputation: 1
Post: #19
Quote:Originally Posted by queeup
I prefer built-in schedule function for this.
http://trac.xbmc.org/ticket/9056



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.
(This post was last modified: 2011-07-28 05:05 by ihaterich.)
find quote
wiggy9906 Offline
Junior Member
Posts: 6
Joined: Feb 2009
Reputation: 0
Post: #20
I use a similar method to update my library. Using windows task manager and a vbscript.

Code:
x = TextFromHTML("http://127.0.0.1/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.updatelibrary(video)")

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
    ie.quit
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:Password@192,168.1.5/xbmcCmds...............
(This post was last modified: 2011-10-09 19:55 by wiggy9906.)
find quote
phillipah Offline
Junior Member
Posts: 3
Joined: Nov 2011
Reputation: 0
Post: #21
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.

Code:
"C:\Program Files\GnuWin32\bin\wget.exe" http://localhost:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))
del "xbmcHttp@command=ExecBuiltIn(UpdateLibrary(video))"
find quote
demori Offline
Junior Member
Posts: 5
Joined: Dec 2012
Reputation: 0
Post: #22
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
Code:
;OLD HTTP API
;Run("E:\XBMC Mod Files\wget.exe http://xbmc:password@localhost:8081/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))", "", "")

;NEW JSON API
Run("C:\curl.exe -H ""Content-Type: application/json"" -X POST http://xbmc:password@localhost: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.

Cheers.
find quote
aceman118 Offline
Junior Member
Posts: 24
Joined: Oct 2012
Reputation: 0
Post: #23
If you want to avoid downloading anything you can just run a powershell script.

Code:
$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
find quote
Post Reply