Kodi Community Forum

Full Version: Finished TV and Movie Automation in a Virtual Machine
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
I've spent the last year slowly trying to perfect an automated system to download, unpack, rename, move, scrape library data, and delete random files and empty folders for TORRENTS. I think I've finally got it and it's all running in Windows 7 x86 Virtual Machine using Virtualbox. That means I never have to redo the automation process again and can put this on as many computers as I want with only having to change directory paths if they are different on the other computer. It also allows me to remote into the virtual system and mess with it while still watching shows on the HTPC.

I might write a detailed guide with images in links in the near future but for now I will just outline it a bit.

1. Install free program Virtualbox and create a machine running whatever version of windows you want. I did Win7x86. Networking needs to be bridged to get its own normal ip address and network with the HTPC. Map network drives of the drives you will need write access to. Install the virtualbox addons.

2. Utorrent - set up rss tv show downloads from your favorite tracker. In the rss downloader label all the tv shows as TV and in utorrent preferences create persistent labels (movies|TV|apps|etc...) and set the option to put finished labeled torrents into a sub directory of their label. Do not need to set a download path for each rss show. The label takes care of that.

3. SCRU - free app for unpacking scene releases (rar files) that can be run by command line. You do not need to setup profiles or monitored directories in it. Just change a few settings.
- edit default profile and have rename extracted file to parent directory checked and select "Disable" in the Directory Append option
- That's it. Close it and we will use it from command line executed from eventghost.
Code:
""{eg.globals.miscPath}" "Z:\Movies Rename Temp""
The "{eg.globals.miscPath}" part of the command line is a new thing I have going. miscPath is a variable that contains the path to my newly downloaded content so that scru knows exactly where to extract from. The creation of the variable is in the eventghost section below.

4. Ember Media Manager - great free app that scrapes all of your movie data and will soon be able to scrape tv shows. Able to run via command line.

5. Therenamer - move and rename movies and tv shows. Just need to set your default TV and Movie directories. Can be run from command line with the simple -fetch or -fetchmovie commands. You can now specify the fetch folder and archive folder from parameters.(Quotes Required)

Code:
fetchfolder: -ff="???"
archivefolder: -af="???"

Examples: (works with -fetchmovie too)

theRenamer.exe -fetch -ff="c:\abc"
theRenamer.exe -fetch -af="d:\def"
theRenamer.exe -fetch -ff="c:\abc" -af="d:\def"

I store my HD movies in a separate directory so this works perfect for that.
my use of it: -fetchmovie -ff="E:\HD Movie Rename Temp" -af="E:\-HD Movies"

6. Belvedere - great free app from lifehacker that can automate a ton of file operations. Some rules I set:
- copy files less than 2 minutes old from TV directory to a secondary directory that therenamer reads from so that you can keep seeding,
- delete all files in TV, movies, etc that are 2 days or more old. Gives time for seeding
- delete sample files, txt, whatever other random left over files from my directories
- I'm also using it to monitor a few other directories and things can get tricky with the rules. Been a lot of trial and error to get it to delete, move or copy files of different extensions and creation dates to different directories and to delete different types of files based on different creation dates. For example I keep my high def files for a few more days to seed longer and I also keep them on another drive.

7. eventghost - need to use the plugin directory monitor that it comes with. You add as many of the plugins as there are directories you want to monitor. A big issue I had was that the directory monitor is not able to monitor a mapped network drive properly. You have to have it monitor the drive through a regular network path to the shared directory on the host box (HTPC). example: "\\HTPC\Torrent-Finished\movies" and not "G:\Downloads\Torrent-Finished\movies" (this one is the path through a mapped network drive). You create a macro for each folder you want to monitor.
example macro for my movies folder:
- event item - DirectoryWatcher5.Created (this one is monitoring my download movies folder for new files)
- Pasing path of movie (python script containing code to put the path of the directorywatcher event into a variable that we can call from commant line later)
Here is the python script code:
Code:
from os import path
fp = path.abspath(eg.event.payload[0])
eg.globals.miscPath = fp
- Start Program: scru.exe (with command line option "{eg.globals.miscPath}" "Z:\Movies Rename Temp")
- Start Program: theRenamer.exe (with command line option -fetchmovie)
- Start Program: Ember Media Manger (with command line option -newauto -all)
- XBMCRepeat: Update Video Library (XBMCRepeat plugin - sends the update library command to any ip address)
- Clear Pending Events
I now use the email plugin to email me what new TV show just finished downloading. I also parse the event so that only the name is emailed to me and not the entire path as well. The plugin is set up with my gmail account using gmail's pop3 ability.

The image below shows two python scripts that parse for the movie path. I no longer use that and only use the one python script that I mentioned above.
Image

For my TV shows:
- event item - DirectoryWatcher4.Created
- parsing filename of tv show (looks at the path in the previous event (above) and grabs just the name of the tv show)
- E-mail: Send e-mail:{eg.globals.testVar} (sends email to my gmail account saying, "New Episode of Example Show")
- Start Program: Belvedere.exe - has a rule that copies all files that are less than 2 minutes old to secondary directory
- Start Program: theRenamer.exe - with command line option -fetch
- Start Program: AutoDeleteFolders.bat (.bat file I made that can be put in any folder and when run it will delete all empty folders and subfolders. I have it in my TV download folder and Movies folder)
Here is the bat file contents:
Code:
@echo off
for /f "delims=" %%i in ('dir "%~f1" /ad /b /s ^| sort /R') do rd "%%i" 1>NUL 2>&1
- XBMCRepeat: Update Video Library (sends the XBMC update library command to the ip of my host machine that is running XBMC)
- Clear Pending Events
(You put the bat file in the main parent directory that you want to clean of empty folders and sub folders)
I have also created a rule in belvedere that deletes all files in my different download directories that are older than two days. Gives them time to seed and you could change that to whatever you want.

8. Desktop replacement - Rainmeter with the Omnimo skin - Beautiful replacement of the windows desktop for a media center.
Image

I also use uremote on my host box as well as my laptop so that I can click a torrent link on a web page and uremote associates itself with the torrent file and sends it to utorrent in the virtual machine.

I think I hit most of it and let me know what you think or if anything needs to be fixed.
sounds nice but isn't the whole thing made redundant by sickbeard and SABnzb?

The 2 of them working together do everything your setup is doing with minimal setup and fuss.

I tried the lifehacker method but found it clunky and messy. therenamer seemed to be screwing up episodes quite often, changing all the filenames into shows I've never heard of. eventghost sometimes forgot what profile it was running and switched to default. I had enough and went the .nzb method with the above mentioned programs.

Now all my shows keep up to date without a hitch. Sickbeard finds the nzb's, passes them to SABnzb for download, then back to sickbeard for the renaming and sorting. Everything works 100% perfectly. For movies I can browse/search for them, there is a google chrome extension that gives you single click download into SAB from several nzb sites. There is even a slick app for webos so that I can do it from anywhere, from my phone. My temporary 'Completed' folder is always empty, sickbeard and SAB take care of all the extracting, moving, and cleaning of useless files. Sickbeard even tells XBMC when a download has started, and you can see it as a message on the TV... really slick. The best part about getting away from torrents is that your downloads are always as fast as your connection, no matter how un-popular the show might be. Plus... no more seeding!

I highly recommend you look into it!
Sounds pretty perefct for TV and have always wanted SABnzb for torrents. This setup was the best I've gotten for torrents and is free unlike most news groups.

therenamer works great for me. It messed up a couple shows but a quick edit to the database in the settings fixed it.

I've been running eventghost for a few weeks now and it has never had a single issue.

I love my torrent speeds. I can download a little over 3MBs a second and it's almost always maxed. TV shows and movies in minutes from my trackers.

For some reason I have not seen sickbeard and it looks like it might be pretty awesome for torrents as well. I'll be checking into that very soon.

It looks like your setup is also just for TV shows and this will work in different ways for my movies, apps, etc.... My movies will unrar, rename, move, clean directories out and get library data all automatically. It would be nice not to have to seed though.
ahh, must be nice to have an isp that doesn't throttle P2P. Sometimes you just want to download something that has very few seeders and speeds can be slow, with nzb's no matter what you download its always max speed, with no fluctuations.

I was very hesitant to move to newsgroups since you basically have to pay to play, but, $15/month is very worth it for me.

Try the giganews free trial. Its supposed to be 10 gigs free or some thing, I managed to squeeze 85 gigs out of them in the first 24 hours before their server even realized I was over limit (lol)

The best part is how hands-off it is. Shows are 100% automatic with zero intervention. I do nothing, new episodes appear in HD on XBMC. For movies, I search from my phone, make one click, and later that day they appear in XBMC. Gotta love it!
That sounds great. After all my hard work I can't switch now. lol

15 bucks a month would be worth it and I bet I'll switch in the future. Sounds like it might be 100 times easier to set up but at least I'm done with the setup. So movies and tv shows are unpacked and organized automatically with sickbeard and SABnzb? That would be pretty awesome.
I must be missing the point...

What's wrong with uTorrent plus a bunch of RSS feeds and perfectly set up RSS downloader (as you mentioned with labels, I use "TV Shows\Name of the tv show", this way all tv shows are downloaded in the folder TV Shows, and every show has its own subfolder.
For all movies I simply use 1 label: "Movies". All my movies are in 1 folder.

And... XBMC! The library updates itself automatically, scrapers go automatically. Done!

I only do not have the automated Unpacking & Renaming:
Since torrents are pretty fast, I am not going to pay for a newsserver. No benefit for me. Therefore I also do not need to unrar anything. Sure sometimes something gets downloaded as rarfiles. But I am also sure that could be fixed easier then your megasolution.

And since I hardly ever see the actual filenames, why bother renaming?

EDIT:
and by installing uRemote, I can click torrentfiles in my browser on my laptop or any other pc in my network. uRemote is nothing more then a .Net based gui that simply represents the web interface of uTorrent. The benefit over the web interface you open via your browser is that the torrentfiles are associated to uRemote and therefore clicking a .torrent link means it will open in uRemote --> wich will upload it to my htpc/downloadpc automatically.
I don't need Windows Live Sync this way.
@zilexa
I like the uremote thing and will check that out.

For me the automation is a big deal. For all of my movie and tv downloads it unrars (a lot of non hd movies are rared for me), renames to a nice pretty name, moves it to the right directory, deletes random files and empty folders and downloads library data to the directories where the files exist (this is a big deal for thousands of movies and tv shows instead of having xbmc doing it).

That's a large list of things to do all the time when you download tons of stuff. I have over 5 terabytes full and it's really amazing to have this kind of thing automated.

I see posts all of the time regarding this kind of thing where people say how hard is it to right click on a file and unrar it. That's not all you have to do. You then need to rename the file, move it, delete the archive and get library data. That's just for one rar file and doing that over and over all of the time is what's really redundant and a waste of time. TV shows are also huge with moving them to their corresponding show directory, giving them a perfect name and getting library data. It makes the process perfect and anyone in the house can sit down, open XBMC and watch whatever they want without knowing any of this is going on. Plus I just love messing with computers and doing crap like this.
yeah if we aren't using computers to automate tasks for us then why invest in them in the first place? Just get a cable box PVR and be happy lol. If you want to spend your time unraring and moving and seeding and whatever then have at 'her.

I for one like all my movie and show files to be organized into folders, and have a common naming convention.
Why would you unrar your tv shows? XBMC reads rar files perfectly.

Everything I watch is automatically downloaded from the fastest scene torrent website in rar format ('cause that's the quickest way to get them) with uTorrent and XBMC adds them everytime they finish (using eventghost to watch my "finished" torrent file directory).

Oh ya, I also use the Extra REGEX from xexe to make sure when episodes are named strangely it still picks them up. http://forum.xbmc.org/showthread.php?tid=51614
@LyndonW
The reason to unpack the files might be, it's ugly as a rar, takes longer for xbmc to read it, not a flexible format (HTPC may also be serving this media to diff devices or computers where a rar does not work) and less folders and files to deal with when the one movie or show could be 1-40 rar files. I also just don't like to look at them so why not automate the process when everything is a bonus.
@zilexa
uRemote is pretty awesome! So far I love it and much better than syncing a folder.
edited a few things so that everything has a chance to seed for at least two days.
Hey Flook, instead of uRemote, you could try uTorrent Adder.
I think you'll like it. I removed uRemote after discovering this. It supports magnet links as well as .torrent links. All it does is pass both these links to your uTorrent machine Smile
For a gui on your remote/client machine, the newest WebUI (I think 0.370, utorrent 2.0 required, not 2.1 as its unstable) is much more complete then uRemote.

And I also found a nice gui for XBMC itself:
http://forum.xbmc.org/showthread.php?tid=71690
Now made it so that I get an email whenever a new TV downloads and in the subject line of the email it says "New Episode of ExampleNameHere". Used some python from the help of Pako on the eventghost forums to parse the file name that was just downloaded and add it to the subject line of the email. To do this with eventghost you also need to download the email plugin and configure it with your email. I'm using it with my gmail account.

Here is the python code I'm using in a Evenghost python script action item before the email action item.
Code:
from os import path
fp = eg.event.payload[0]
head, tail = path.split(fp)
name, ext = path.splitext(tail)
eg.result  = "New Episode of %s" % name
eg.globals.testVar = eg.result

Then in the email action config I put
Code:
{eg.globals.testVar}
in the subject line. That made the subject equal to the result of the previous python script.
@ zilexa
Looks great! I'll check it out. For the time being uremote seams perfect for me because I also need to set my label right away for movies and apps. TV show labels are automatic but I need to set the other labels so things download to their proper directories and my automated stuff can do its job. Maybe utorrent adder has that functionality. I'll check it out.

Thanks
Pages: 1 2 3 4 5 6 7