We've featured a fully automated media centre set-up before, but Lifehacker reader Andre has improved on these methods, allowing you to download torrents to your media centre while still seeding them to others.
The basis for this guide was this fantastic guide written by Alex Ward. Kudos for alerting me to the existence of The Episode Downloader and The Renamer which are integral to this setup.
Following the instructions in the guide above, however, does not allow you to continue seeding a new torrent. The Renamer moves the file into a new location. By following this guide it will be possible to continue seeding your torrents for as long as you like while still getting your files added to the media centre as soon as they become available.
This guide is written with Windows users in mind. It should be relatively simple to adapt for other operating systems. Also, the XBMC installation described here is a stand-alone Linux version.
What You'll Need
- uTorrent v2.0 or higher
- The Epidsode Downloader (TED)
- The Renamer
- wget for Windows
- Robocopy (part of the Windows Resource Kit – only required if your OS is XP)
Create The Necessary Folders
Once we have downloaded all the required software we can start creating the folders we'll need to move our files from being downloaded all the way through to the media folder. Here are the ones you'll need:
- Create a Batches folder to keep scripts required to move files and logfiles (C:Batches)
- Create an Incomplete torrents folder (In this guide this will be C:TorrentsIncomplete
- Create a Complete torrents folder (c:TorrentsComplete)
- Create a Movies folder in the Complete Torrents folder (C:TorrentsCompleteMovies)
- Create a working folder for The Renamer software to use (C:Rename)
- Create a subfolder for new series in the Renamer working folder (C:RenameSeries)
- Create a subfolder for new movies in the Renamer working folder (C:RenameMovies) (Optional – only required if your XBMC installation is on another machine)
- Create a folder to contain series before copying to the media PC (C:MediaSeries)
- Create a folder to contain movies before copying to the media PC (C:MediaMovies)
Configure Your Software
The Episode Downloader
The Episode downloader software monitors when episodes become available on torrents and automatically adds the downloaded torrent files to your torrent downloading software. It keeps track of when new episodes become available. The software is fairly simply to use.
uTorrent is used to download and upload torrents. The first time you start uTorrent it will run a quick setup. I recommend accepting the settings provided by this setup. Once the setup is complete, and you see the main uTorrent screen click on Options, Preferences and click on the Directories link in the sidebar.
Complete the options as displayed above:
Put new downloads in
This is the location that new torrents will be kept in until they are complete.
Always show dialog on manual add
Deselecting this option will allow uTorrent to automatically start downloading new torrents that are added instead of displaying a dialog box.
Move completed downloads to:
This is the folder where completed downloads will be stored
Append the torrent's label
This option will append the label (in our case Movies) to the end of the label to ensure that we can keep series and movies separate.
The Renamer will clean up the names of the files that have been downloaded from the internet. It can clean up the names of both series and movies.
By default you should see the TV Shows screen:
If you do not (i.e. the screen is blue) simply click on the word movies to switch to the series screen. Now click on Settings and ensure that the folders are correctly configured:
Click on Close.
Now we need to configure settings for movies. Click on the word tvshows to change to the movie mode.
Click on Settings.
Under the fetch folder option browse to the folder which contains your Renamer working folder. Under the Movies Archive option select the folder where your movies will end up before being copied to the media source folders.
Ensure that the web UI has been enabled as described here. If XBMC is on the same machine as the one doing the downloading, just configure XBMC to use the Media folders as source folders for TV Shows and Movies.
If you have XBMC installed on a separate Windows machine you need to share the folders containing the media. I would suggest keeping it simple by creating two shares; one for TV shows and one for movies.
If you're using standalone XBMC on a Linux machine, follow the instructions on the XBMC Wiki to configure Samba. Create a share linking to your video source on the XBMC machine. It is important to ensure that the share is writable and that guest access is allowed. If you prefer to implement usernames and passwords you will need to map a persistent network drive.
Create Scripts And Schedule Them To Run
Open the C:Batches folder and using notepad create a file called <Download_to_rename.bat, containing the following:
ROBOCOPY C:TorrentsComplete c:RenameSeries /NP /M /S /XD C:TorrentsCompleteMovies /LOG+:c:BatchesRename_series.log "C:Program FilestheRenamertheRenamer.exe" -fetch
CHOICE /D:A /C:AB /T:300 > NUL
ROBOCOPY C:TorrentsCompleteMovies c:RenameMovies /NP /M /S /LOG+:c:batchesRename_Movies.log
"C:Program Files (x86)theRenamertheRenamer.exe" –fetchmovie
Robocopy is a robust Microsoft file copying utility. Here is a breakdown of the first command:
C:TorrentsComplete is the source folder.
C:RenameSeries is the destination folder.
The /NP switch prevents robocopy from displaying the percentage copied complete which would fill up the log file with unnecessary information.
/M copies all files with the Archive attribute set and resets the Archive attribute (this flag allows us to only copy the new files that has arrived since the previous time we copied the files).
/S copies all the files in this folder and all subfolders
/XD will exclude the Movies folder so that we only copy the series folders but not the movies folders.
/LOG+:c:BatchesRename_series.log instructs Robocopy to create a logfile and keep adding to the file. As soon as the process is working properly this setting can be removed.
The command "C:Program FilestheRenamertheRenamer.exe" -fetch launches theRenamer and instructs it to treat the files in the C:RenameSeries as TV shows.
The CHOICE /D:A /C:AB /T:30 > NUL command waits for 30 seconds before continuing the batch file. This will allow theRenamer to properly close before starting the process again.
The ROBOCOPY C:TorrentsCompleteMovies c:RenameMovies /NP /M /S /LOG+:c:batchesRename_Movies.log command uses the same format as the previous Robocopy command, except that it uses the Movies folder and does not require any exclusions.
The "C:Program Files (x86)theRenamertheRenamer.exe" –fetchmovie command will start theRenamer but treating the files as movies and renaming as appropriate.
Create a second file in the same folder, called Copy_to_htpc.bat, containing the following:
robocopy c:Movies \htpcMovies /NP /MOVE /S /R:1 /LOG:c:BatchesMovies.log *.* robocopy c:Series \htpcSeries /NP /MOVE /S /R:1 /LOG:c:BatchesSeries.log *.*
c:wgetbinwget —spider —http-user=xbmc —http-password=password http://htpc/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video))
if not exist c:MediaSeries mkdir c:MediaSeries
if not exist c:MediaMovies mkdir c:MediaMovies
In the first two commands,
/MOVE will move the files instead of copying and /R:1 will only retry once before giving up.
The C:wgetbinwget —spider —http-user=xbmc —http-password=password http://htpc/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video)) instructs the XBMC server to update the video library.
—spider tells wget not to download any files.
—http-user and –http-password are the username and password configured for web access.
The http://htpc/xbmcCmds/xbmcHttp?command=ExecBuiltIn(UpdateLibrary(video)) command causes the XBMC server to execute the instruction.
During the move the source folders are removed once the copying is completed the last two lines will recreate the folders in preparation for the next time the script is run.
Go to Start > All Programs > Accessories > System Tools > Task Scheduler and select the Create a Basic Task option in the right-hand sidebar. Give the task a name and click on Next.
Leave the selection on Daily and click on Next. Modify the start time as required and click on Next. Leave the Action to Program and click on Next. On the following screen browse to the first script (Download_to_rename.bat), click on OK and then click on Next.
Click on the "Open the Properties dialog for this task when I click Finish" option and then click on Finish.
The advanced properties dialog box will now be displayed. Click on the Triggers tab and double-click the only trigger that should be here. Click on the "Repeat task every:" option.
Click on OK, and OK again to complete. Repeat this process but use the second batch file. Change the time to ensure that there is sufficient time for the first batch file to complete before starting the second batch file, and you're finished!