xbUpdate :: alpha version released

xbUpdate is a python script written for XBMC running on Windows (tested on XP SP3) which monitors the folders you added to your library for file changes. So, if you downloaded a video torrent and unpacked it into your media folder, the script will automatically identify it and update the library with its details.
The package here is a first alpha version which basically “works on my machine”, the main open issue I currently have is with the script failing to gracefully shutdown. I’m working on sorting it out, but it will take me more than a couple days to iron out all the bugs and issues. That’s where you can be very helpful with your comments…

I find it to be very useful in scenarios like I have where I download several episodes on a regular basis and I need to update the library several times a day. Each time takes a while because of the library size and now it simply happens immediately without interfering or delaying my viewing.

Once you install the script there’s no need to configure anything, because it’s based on your XBMC library, it takes the folder lists from directly from it. It’s important to note that it runs recursively over the folders, so as long as you set a “content type” on your folder, the script will catch it.


Download Instructions:

  • Download the package from here.
  • Unzip its contents into your XBMC script folder, usually: c:\program files\xbmc\scripts. You should now have a folder called xbUpdate under your scripts folder.
  • Move the folder pysqlite2 to your system\python\DLLs folder, usually it’s in: c:\program files\xbmc\system\python\DLLs
  • If you wish to run the script automatically when XBMC starts and you probably do.
    • In your scripts folder, locate a file called autoexec.py, if it doesn’t exist then you can simply copy the existing one from the xbUpdate folder and skip the next step.
    • Make sure that the first line in the file is import xbmc
    • At the file’s end paste the following line:xbmc.executescript('q:\\scripts\\xbUpdate\\default.py')
    • That’s it, on its load the script will load the list of folders to monitor from your library and every change made in it or its sub-folders will trigger a library update.

There are a few more features that I’d like to add before the beta, mainly:

  • Fix the issue with the graceful shutdown
  • Support library folder changes after the script has already started
  • Some level of control over what folders are to be scanned
  • Add support for Music folders – very important
  • Your suggestions…

Tags: , , , ,

7 Responses to “xbUpdate :: alpha version released”

  1. glynn says:

    Thanks for your great script.

    Can I suggest replacing your sql call
    conn = sqlite2.connect(‘T:\\Database\\MyVideos34.db’)
    print “opened ok”
    c = conn.cursor()
    rs = c.execute(“select * from path where strContent != ””)
    .
    .
    .
    c.close()

    with

    res = xbmc.executehttpapi(“queryvideodatabase(select strPath from path where strContent != ”)”)
    rs = re.findall(‘(.*?)’,res) # find it

    It gets over your database problems with the dll and should be completely portable, even if the database base changes. It doesn’t need the web server to be running either.

    I have to use a smoothvideo version of XMBC and your script would not work with it. After a bit of playing round I gave up and found this method.

    Regards
    Glynn

  2. Wow, that looks much better and the fact it sorts out the dll issues, a huge extra. There’s so much more to learn about this beast…
    I’ll give it a try and resubmit the post with your suggestion.

    Thanks a lot.
    Itay

  3. rgf21 says:

    Hi. Great Idea for a script.

    I’m having a problem with my xbmc. Sometimes I find a new version (better quality…) of a tv episode, one that I already have in my library. Can you make your script update the entry with the new file instead of creating a new one? Thanks and keep the good work.

  4. Paul says:

    Itay did you update to reflect glynn’s changes?

  5. bullpen says:

    Itay,

    I was wondering if you made any headway with reposting with glynn’s recommendations. I’ve been using the xbox for about 18 months and am very interested in a solution that would allow me to incorporate torrent search capabilities. I’m currently working on putting together a Linux based HTPC to replace my xbox.

    Thanks,
    Carl

  6. Abhay says:

    i have an error when i run my python script as “No module named emulator”….
    its because in my xbmc.py file there is a statement

    import emulator

    and there is no emulator.py in Lib

    what to do? from where can i get that emulator or any other solution?

  7. Chris says:

    Thanks for creating this script. This was a missing feature that I was hoping would be added.

Leave a Reply