[WINDOWS] HOW-TO schedule automatic library updates - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85)
+--- Forum: Tips, tricks, and step by step guides (/forumdisplay.php?fid=110)
+--- Thread: [WINDOWS] HOW-TO schedule automatic library updates (/showthread.php?tid=65681)
[WINDOWS] HOW-TO schedule automatic library updates - Pr.Sinister - 2010-01-01 12:45
Hello Boys and Girls...
Sometimes, something that seems so easy or so obvious to you may not be so
easy for someone else.
I always figured most people had their own special way of automatically updating
their libraries but it seems i was mistaken. There are dozens of ways of doing this
but here i will explain one that will open up so many other possibilities for end-users.
Here we go...
What you need :
- Knowledge of the Windows Task Scheduler
- AutoIt v3
- Wget for Windows (mirror)
If you prefer, you can use FireFox instead of WGet.
So install the full AutoIt Suite and use this code and save it into a file with the .au3 extension
Once you have edited the code to use your username and password as well as
the correct IP address for your XBMC, save it, right-click on the file in Explorer
and select Compile Script.
This will create the executable file you can use in the Windows Task Scheduler.
Pretty easy no?
- Instead of an IP, you can use the hostname of the XBMC machine
- If you are running the script from the XBMC machine, localhost can be used instead of IP
- The wget.exe file is a standalone .exe so you can put it anywhere you want as long as you point to the right one in the script source
- AutoIt comes with an extensive help file (.chm). Each function has examples and there are lots of pre-made scripts to use. Check these out for some fun advanced features to help you automate anything you can think of.
For Firefox Users - Pr.Sinister - 2010-01-01 12:49
If you would prefer using FireFox, here is the code.
Be advised that if FireFox finds updates for your addons or for itself, the script
will fail until you manually update firefox
Do more than just update Library - Pr.Sinister - 2010-01-01 12:56
Someone asked if it was possible to do more than just the simple update library.
One example was to:
- Close XBMC
- Run AntiVirus Scan
- Run Defrag tool
- Run XBMC
- Update Library
Here is a script that does just that :
The script is commented so you can understand what's going on. Use the AutoIt Help File for anything you don't understand or if you want to add extra stuff.
HAPPY NEW YEAR!
- DurhamDev - 2010-01-01 14:15
That's awesome, Pr. Thanks so much. I've implemented the final script, albeit with a few changes for different defrag and antivirus programs, but it runs like a dream!
One question: if I wanted to run the other scripts, and considering I'm using 'localhost', I do have to configure the 'internet access' component within XBMC, correct? (I haven't done it previously, so any help would also be appreciated!) I'm also going to look into some of the other commands that can be sent to the XBMC, and see if I can find others such as "clean the database".
Thanks again! That's awesome!
- Pr.Sinister - 2010-01-01 17:02
DurhamDev Wrote:One question: if I wanted to run the other scripts, and considering I'm using 'localhost', I do have to configure the 'internet access' component within XBMC, correct? (I haven't done it previously, so any help would also be appreciated!) I'm also going to look into some of the other commands that can be sent to the XBMC, and see if I can find others such as "clean the database".
If you are going to use localhost, do this :
In your XBMC Settings, under Network, you would need to enable :
- Allow control of XBMC via HTTP
- Port 80
- Allow programs on this system to control XBMC
This is under Settings | Network | System in Aeon. Not Internet Access.
There are a bunch of things that can be done via the Web Server HTTP API
but to do the clean library, i suggest you just enable the Clean Library on
Just create a file called advancedsettings.xml and under the videolibrary tag,
add <cleanonupdate>true</cleanonupdate>. That file then goes into your
Here is what my advancedsettings.xml looks like
DurhamDev Wrote:Thanks again! That's awesome!
You're very welcome buddy!
- DurhamDev - 2010-01-01 20:04
This is great. Of course, once again, I have more questions. I checked the Wiki on advancedsettings.xml, and it had some similar settings for both the video and music libraries, however, it doesn't explain a few things. For example, the "hideallitems" arguments. Is this effectively 'removing' all items from the library, and rescraping them from scratch, or something different? Secondly, what does the "recentlyaddeditems" argument do?
(Is there a better Wiki or place to look at?)
Thanks, in advance!
- Pr.Sinister - 2010-01-01 22:05
DurhamDev Wrote:For example, the "hideallitems" arguments. Is this effectively 'removing' all items from the library, and rescraping them from scratch, or something different?
In TV Shows, say you have all seasons of the show 24. When selecting the show,
you can choose Season 1, Season 2, Season 3, etc... and ALL SEASONS.
That setting only hides that "ALL SEASONS" listing. It doesn't remove anything
from the library.
DurhamDev Wrote:Secondly, what does the "recentlyaddeditems" argument do?
That determines the amount of items that are displayed when choosing
"Recently Added Movies" or "Recently Added TV Shows" from the video library.
For Example, if you use Aeon Hitched as your skin, in the main menu, highlight
Movies and press down. Choose Recent. It will display the movies newly added
to your library. By default, it is 25 but i prefer 50 for TV episodes.
- IsleOfMan - 2010-04-11 01:35
Not sure if anyone is still reading here, but when I try the Firefox method, I get the following confirmation box that requires action before the script will continue:
Quote:You are about to log in to the site "192.168.2.2" with the username "xbmc".
I'm running Firefox 3.6 and can't find a way to disable this particular popup. Any help?
- queeup - 2010-04-11 02:04
I prefer built-in schedule function for this.
- hermy65 - 2010-04-14 18:51
my path for wget is different then yous so im curious if this is the correct configuration then.
Run("C:\Program Files\GnuWin32\binwget.exe http://username:password@localhost/xbmcCmds/xbmcHttp?command=ExecBuiltIn%28UpdateLibrary%28video%29%29", "", "")
; Delete the file created by wget