• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 14
XBMCSync - Sync Watched Flag Across Multiple Boxes
#1
I decided last night I needed to write a script to sync the watched flag across all of my XBMC boxes. I have this up and working for my situation, but if there are other folks that are interested I would be glad to try and extend it to meet some other folks needs.

Currently I just have this running outside of XBMC in a cronjob. Every 30 minutes, it connects to all of my machines, downloads any updates, updates its internal database and then pushes the updates out to all of the other machines.

If anyone else is interested, I would be glad to work with a few folks to make sure it works as expected outside of my environment. I have only tested on Camelot running on Ubuntu 9.10.

Thanks
Tim
Reply
#2
Tim- i love this idea and should use it if i only had 2 XBMC boxes. But the idea is good and maybe in future a 2nd box !!!!!!!.
Thanks for your work.

Bob
Reply
#3
I would love to try this! I have been waiting for a feature like this (actually a central db has been my wish) for a long time. I must confess that I don't know much about Linux, so I'd probably need some help getting it up and running. I have 2 boxes running XBMC Live. All my media is on a central server. Let me know if you think it will work for me.
Reply
#4
Hello,
It is looking like a good idea.
But would it works across platform?
My setup is as follow, I have an NAS where my movies and xbmc program are, so no need for syncronisation (I launch the application via a map network drive and use the -p option)

Now sometimes i am using a Mac with localy installed xbmc

And your script can be useful if we can synchronize cross platform.
Reply
#5
RockDawg: It should be no problem getting you up and running. I'll shoot you a PM to get you the info needed and we can get your testing started

michaelcdf: Yes, since I am using the web API any version of XBMC should work fine. I have only tested the central process running on a linux box, but it should run on any platform that supports python. I will make a windows exe at some point as well. I'll shoot you a PM as well
Reply
#6
This is a great idea IMO! I've been waiting for a centralized DB structure for a long time but this would be fine for me. I have a Mac Mini, ATV, iMac and MBP that I would like to keep in sync. Can I get in on the testing?
Reply
#7
mtehonica: sure thing. I will shoot you a PM with the info to download and try it out. I am redoing some parts now so hopefully I'll have another update for it tomorrow or so.

An additional thing to note is that you dont have to use the same library on all of the machines. I have one that is just a childrens library but it still syncs the watched flag on anything common between them.
Reply
#8
tim- Wrote:mtehonica: sure thing. I will shoot you a PM with the info to download and try it out. I am redoing some parts now so hopefully I'll have another update for it tomorrow or so.

An additional thing to note is that you dont have to use the same library on all of the machines. I have one that is just a childrens library but it still syncs the watched flag on anything common between them.

Sounds great! I'm sure my setup will give it plenty of testing, haha. Can I assume it will only mark a show watched and never mark it unwatched? My situation: I have a fresh XBMC install on my ATV and my Mac Mini has pretty much all my content already with all the correct flags.
Reply
#9
It probably needs plenty of testing =)

That is correct, all it does is mark things as watched, never unwatched. If you ever have the need to bring a new machine online that has nothing after the first update there is an option to run it with 'fullsync' which will do a total update to get all boxes 100% in sync as well by aggregating what every box has as marked and the pushing it out to everyone instead of doing an incremental update.
Reply
#10
I'm getting an error:

Code:
kevin@XBMCLive:/home$ python xbmcsync.py newdb
Traceback (most recent call last):
  File "xbmcsync.py", line 36, in <module>
    conn = sqlite3.connect('xbmcsync.db')
sqlite3.OperationalError: unable to open database file

Here is my config.ini:

Code:
[HTPC1]
address=127.0.0.1
webport=8080
username=xbmc
password=xbmc

[HTPC2]
address=192.168.1.7
webport=8080
username=xbmc
password=xbmc

HTPC1 is the pc that the script is on and it is running XBMC. HTPC2 is my other XBMC box. Any ideas?
Reply
#11
RockDawg Wrote:I'm getting an error:

Code:
kevin@XBMCLive:/home$ python xbmcsync.py newdb
Traceback (most recent call last):
  File "xbmcsync.py", line 36, in <module>
    conn = sqlite3.connect('xbmcsync.db')
sqlite3.OperationalError: unable to open database file

Here is my config.ini:

Code:
[HTPC1]
address=127.0.0.1
webport=8080
username=xbmc
password=xbmc

[HTPC2]
address=192.168.1.7
webport=8080
username=xbmc
password=xbmc

HTPC1 is the pc that the script is on and it is running XBMC. HTPC2 is my other XBMC box. Any ideas?

Is your xbmcsync.py located in the same directory as your xbmcsync.db?
Reply
#12
RockDawg Wrote:I'm getting an error:

Code:
kevin@XBMCLive:/home$ python xbmcsync.py newdb
Traceback (most recent call last):
  File "xbmcsync.py", line 36, in <module>
    conn = sqlite3.connect('xbmcsync.db')
sqlite3.OperationalError: unable to open database file

Here is my config.ini:

Code:
[HTPC1]
address=127.0.0.1
webport=8080
username=xbmc
password=xbmc

[HTPC2]
address=192.168.1.7
webport=8080
username=xbmc
password=xbmc

HTPC1 is the pc that the script is on and it is running XBMC. HTPC2 is my other XBMC box. Any ideas?

Do you have permission to write in the directory you are running the script from? Try running it with sudo and see if you get the same results.
Reply
#13
tim- Wrote:Do you have permission to write in the directory you are running the script from? Try running it with sudo and see if you get the same results.

I'm at work right now, but I'll try that when I get home this evening. I put the script in the Home directory. I wasn't sure where the best place to put it was.
Reply
#14
RockDawg Wrote:I'm at work right now, but I'll try that when I get home this evening. I put the script in the Home directory. I wasn't sure where the best place to put it was.

OK, I tried it with sudo and here's what I get:

Code:
kevin@XBMCLive:/home$ sudo python xbmcsync.py newdb
[sudo] password for kevin:
Processing frontend: HTPC1
HTTPError = 401
Processing frontend: HTPC2
VIDEO_TS.IFO appears to be new
American History X.M2TS appears to be new
Bolt.m2ts appears to be new
Fast and Furious.M2TS appears to be new
Identity.M2TS appears to be new
The Dark Knight.m2ts appears to be new
The Shawshank Redemption.m2ts appears to be new
Traceback (most recent call last):
  File "xbmcsync.py", line 85, in <module>
    except httplib.HTTPException, e:
NameError: name 'httplib' is not defined
Reply
#15
I'm not an expert by any means, but that looks like a python issue, not an issue with the script. I'm running the same script on my Ubuntu machine and it works perfect. What version of python are you running?
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 14

Logout Mark Read Team Forum Stats Members Help
XBMCSync - Sync Watched Flag Across Multiple Boxes0