Release [Release] MediaCopier AKA 'XBMC-agogo' - Kodi on holidays &/or Sharing Libraries
#1
Available here (still working 10 years later!):
https://github.com/bossanova808/MediaCopier

Description

This tool is a gross python hack script to try & make two common processes easier:
  • You have a large media library (movies and TV shows), and you want to share this library with your friends/family
  • You want to take the unwatched portion of your own library with you on holidays - 'xbmc-agogo' if you will.

Paired with a little Kodi machine like an ODroid N2 running CoreElec, you can have a very full Kodi experience anywhere you go that has an HDMI friendly TV. Using the trakt.tv addon, this agogo process can even mark off all the stuff you watched on holiday when you get back!

This system basically lets your friends and family subscribe to TV shows - they then just periodically bring/send their hard drive to you, and you run a fully automatic update which copies all new episodes and/or selected movies since the last update.

Alternatively it can inspect your current Kodi library and grab all the unwatched tv and/or movies from it and send them to your holiday machine.

.....more on github: https://github.com/bossanova808/MediaCopier




Original discussion that inspired this project below....

Ok, so given NUCs are so cheap and good (those littel Bay Trail boxes with OE are pretty sweet!)...I am thinking I want to take XBMC on the road...a little mini box full of media for holiday watching.

In short, I want to take a NUC with a 1.5 TB drive in it with me, with some stuff for my kids, and basically a library of all my unwatched TV. To get thsi on to the NUC, I am looking gor an easy means of identifying all unwatched TV epsiodes as a list that I can then copy to the NUc.

I won't necessarily have internet while on holiday, so ideally on return this NUC could be plugged back into the home net, and then somehow mark off all the things (movies and TV) we watch while away (which can be a fair bit - young kids means we get trapped in the evenings!). I was thinking of trakt for this but I think it's more a 'mark as you go' type thing more than an after that fact library sync tool.

Basically, I am looking for ideas on how best to make this happen. I am reasonably handy in Python so could probably write stuff, but are there existing solutions I am not aware of, or things that might be easy to adapt. Does anyone do this? How do you work it, if so? Yeah I can do it all manually but it would be much cooler to have some sort of automatic solution - fill the NUC with unwatched stuff, and on return mark it off in the main library.

Any help much appreciated!!
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#2
Great idea and I'm eager to hear about any answers myself.
TV: VIZIO E-Series 43”
HTPC: Raspberry Pi 3
STORAGE: Windows 8 Server with DrivePool (Currently with 24TB)
Reply
#3
I do something similar with my laptop when I'm on business travel. Before I leave my home I load up my laptop with the latest tv shows and movies I have not watched or might want to watch. I pack a programmed Tivo remote for my laptop and an HDMI cable so I can plug the laptop into the hotel tvs. If I run out of content or want to watch something that just aired I setup an ad-hoc network with my phone so I can download anything I want with out being throttled by the hotels wireless network.

I also use the Trakt.tv service. Its fantastic. I use it as a backup of my watched flags to my XBMC database in the event xbmc's database becomes corrupted.

Everything is manual for me. I want to run a single MySQL database on my network but I download ne content from multiple clients and the MySQL setup only supports storing content in a central location. It would be awesome if the developers worked the UPnP stuff into a meshed network and integrate all the libraries together. If there are multiple libraries with the same movie but in different formats (HD, SD, different audio tracks) when you go play said movie you'd get a popup asking you what format you want to play. This is similar to when you play a partial view movie where it ask you if you want to resume where you left off. Also it would be nice in the UPnP Stuff if you can have a transfer this morvie to this device option in the context menu.

Thats the end of my rant but I do like using XBMC when I'm on business travel. Hopefully they add these UPnP feature in XBMC 14 - Hodor.
Reply
#4
I think the easiest option for you would be to keep the laptop synced with your library until you head off on holiday, when you return export the library and re-import it to your home library.

Im sure you could easily turn this into an addon which had a check out and check in functionality.

Without network access whilst away i cant see a way of doing this live.

Hope this helps, and if you turn it into an addon i would definitely be using it!
Reply
#5
Just to add my two sense into this discussion (after all isn't that why we post, to get many points of view?) Not withstanding the obvious, which is you're on the vacation, isn't there more exciting things to do? I suspect that you'll need the O/S copy tools and it's real handy to load-up XBMC on one screen (could be a window, depends on your desktop real-estate) set up the copy procedure (I prefer Teracopy, but there is all kinds of file managers) with a drag & drop set-up, looking at what I want from the XBMC cover flow interface, it's easy to drag & drop copy to the target sequentially.. I can usually copy 1TB and hour but it would be an unusual situation to need more, especially for a vacation time period. Keeping the watched/unwatched status, I would go with DoubleT's suggestion although Trakt.tv would be a good choice.
Reply
#6
@PatK - like I said, young kids tend to trap us in our accommodation in the evenings. I knew someone would make that point but basically we play hard with the kids all day long then fall in a bit of a heap once we finally get 'em in bed.... I take a laptop, too, of course, but want to be able to use that while my wife watches something via the NUC or whatever. Have been taking a WD Live for years and it works well, just want a slicker version now and to automate it.

I am giving trakt a whirl - not sure how it will do with a 'sub library' on the NUC but hopefully it will sync watched episodes from the NUC when I get back, then back out to my three other XBMC boxes (well actually to the mysql master library/server).

Looks like I will have to write a script to find my unwatched episodes for copying. Probably easiest thing is to just write something that reads th watched status and paths straight out of mysql...I'd like to do it via JSON/xbmc but ultimately need the local paths for the copying. I have previously built a system that lets my parents-in-law subscribe to TV shows on our system and then auto-copies new episodes to their hard drive when the bring it over about once a month...so this will end up as an extension of that I think.
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#7
This thread has got me thinking. Sure, there's some awesome stuff coming in XBMC's future that will actually do this, allow you to take part of a library and go mobile and then mesh it back with the main library, but I like the challenge of figuring out how to do something close for the meantime :)
Reply
#8
Some testing this morning shows that trakt should be ok for the marking as watched side of it - basically using a sub library on the NUC I can mark a movie as watched, then trigger a manual trakt sync, and it marks it as watched on trakt, then a manual sync on my main xbmc machine marks it as watched there too. So I think that side of it is the easy part.

That said trakt over-rules xbmcs - so once a movie is marked as watched, I can't mark it unwatched on the nuc and push that to trakt. So the trick there would be to not mark anything accidentally as watched...otherwise you have to go to trakt and manually mark it unwatched, which is harder than it should be (easiest way seems to be go in to history and use the little X to delete it - seems impossible from the movie page itself).

The harder part is the copy of the unwatched stuff before going away....but I have previously built a sort of automated copier system, so for me the main thing would be to add a JSON call to XBMC to check the watched status maybe...or jsut pull it from mysql. Will mull that over. If I do make anything, I will clean up my code and whack it on github
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#9
There's a watched import/export add-on that someone made: http://forum.xbmc.org/showthread.php?tid...pid1401643
Reply
#10
This may get you started..

Code:
import json
import urllib2
import base64

host = '192.168.1.113'
port = 1234
username = 'xbmc'
password = 'xbmc'

def xbmc_json(data):
    data = json.dumps(data)

    request = urllib2.Request('http://%s:%s/jsonrpc' % (host, port), data, {'Content-Type': 'application/json', 'Content-Length': len(data)})

    if username and password:
        base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
        request.add_header("Authorization", "Basic %s" % base64string)

    f = urllib2.urlopen(request)
    response = json.loads(f.read())
    f.close()
    return response

json_data = {
    'jsonrpc': '2.0',
    'id': 0,
    'method': 'VideoLibrary.GetEpisodes',
    'params': {
        'properties': [
            'file',
            'playcount'
        ]
    }
}
data = xbmc_json(json_data)['result']['episodes']
episodes = [x['file'] for x in data if x['playcount'] == 0]


#write list to file
filename = './episodes.txt'
f = open(filename, 'w')
for x in episodes:
    f.write("%s\n" % x.encode('utf-8'))
f.close()
Image
Reply
#11
Thanks!

I've been working away in the background and have pretty much finished actually the copier side of it actually - it's doing a trial run tonight. Turns out I have 500GB of unwatched TV in all!!

Basically, I used JSON to get all shows with unwatched episodes, then the first episode for each show, and then essentially used my exisiting media copier tool to do the rest.

I will have to try and clean it up and generalise it for others...but I will put it up on github soon, anyway, even if as just a proof of concept for others.

So - I have a once lcik update system to update the NUC which copies all unwatched TV and prompts for any recent movie additions (I couldn't fit my whole unwatched movie library, so that works more of a 'you have these 10 new movies...do you want to take SomeMovie on holiday [y/n]' etc. This means if I have any cool new ones they can come, but the TV is all automatic.

I run trakt manually at the end of a trip to mark off all the watched, then probably just blank out the TV on the nuc ready for the next pre-holiday update.

I'll blog it all down in detail soon, but I think hassle will be low and cool factor pretty high!
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#12
Out of curiosity, is your existing media copier tool a python addon for XBMC? Because that would be an absolutely awesome little addition. It'd be super useful to have an addon (both for traveling NUCs and also tablets and such) that created a temp local video folder, and then downloaded videos from the central repo to the temp folder. I personally wouldn't even care about the marked-as-watched aspect. For me, it'd all be about copying things over the wireless without having to exit out of XBMC itself.
Reply
#13
@bossanova808

seeing as you are a fellow aussie and most likely aware what it is like getting cool products like this down here i was curious what NUC were you thinking of using for your HTPC

I was looking at them a while ago to use with Openelec but the prices were really high hopefully they have gone down now and i am looking at buying one probably from PCCG here is the page of the ones they have can you recommend one as cheap as possible but also will run openelec fine

http://www.pccasegear.com/index.php?main...38dd4e1610

if none of these can you give me an idea of what i am looking for spec-wise to work well with Openelec and stream everything to Mp3's to Blurays over my network
Reply
#14
@protocol77 I got the 2820 nuc and whacked 4gb and a 1.5tb drive back in it. Install openelec - job done basically. Even on off by harmony remote.

(I haven't tried bluray isos but very big 1080p mkvs no issue at all, HD audio etc)
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#15
@natethomas its a nasty hacked together windows and even bossanova808 specific script right now but I will see what I can make of it maybe. Need to clean up and remove some hard coded stuff first, then will put on github and go from there.
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply

Logout Mark Read Team Forum Stats Members Help
[Release] MediaCopier AKA 'XBMC-agogo' - Kodi on holidays &/or Sharing Libraries0