Page 1 of 1

[HOWTO] Semi-Automated Download Mediacenter...

Posted: 18 Jan 2013, 10:27
by enumo
Howto Semi-Automate Torrent Download to XBMC using Filebot
After running this setup for a few days its not perfect. At the moment im experiencing some problems that the script will not finish completely because of files that need to be deleted are in use either by windows or xbmc. The script will hang until the pc is reboot. I do not support this at the moment .Im looking to create a new way. Please use at your own risk !!!!

#############################################################################
GOAL
The goal is to achieve a semi-automated download with uTorrent and XBMC.
Q: What does this mean?
A:
  • Step 1. You put a .torrent file into a folder
    Step 2. uTorrent auto downloads the file
    Step 3. When torrent completes uTorrent starts a script.
    Step 4. Script will sort out what type of dowload it is
    (Movie or TV-Show).
    Step 5. Script will rename and move files to correct folders
    for use of XBMC(specified)
    Step 6. Script will Clean up directory's (uTorrent cannot
    seed the file after script is run)
    Step 7. Script will put a log into a directory (specified)
    Step 8. On next re-run of the script, the script will
    auto-remove the last log-file.
#############################################################################
This was tested on Windows 7 64 Bit Ultimate, it may
result different in 32bit or other windows versions!


Q: What do we need.
A:
  • - Windows 7 Ultimate 64bit
    - Java 7 Upd 11 32 Bit (= Needed for Filebot)
    - Java 7 Upd 11 64 Bit (= Needed for Filebot)
    - XBMC 11.0 (Eden) (Mediacenter APP)
    - Filebot 3.2 (Best Renaming/Sorting app ever!)
    - uTorrent 3.2.3. (Torrent Client Downloader)
#############################################################################
Q: What needs to be done? (a lot) :D
A:
First step:
  • 1. Think about your folder structure, you'll need the following folders:
    - Movies_Folder (Mine is called C:\Media\Films\) (XBMC will be reading/playing from here)
    - TVShow_Folder (Mine is called C:\Media\Series\)(XBMC will be reading/playing from here)
    - Downloads_Folder (Mine is called c:\Media\Downloads\torrents\)(.torrent file for download here)
    - Move_Folder (Mine is called c:\Media\Downloads\Temp\)(uTorrent store folder)
    - Sorting_Folder (Mine is called c:\Media\Downloads\Compleet\)(Sorting folder for filebot)
    - FinishedTorrent_Folder (Mine is called c:\Media\Downloads\Compleet\ttemp\)(.torrent completed)
    - ScriptFiles_Folder (Mine is called c:\Media\Scripts\Files\)
    - ScriptLog_Folder (Mine is called c:\Media\Scripts\Log\)
    - Root_Folder (Mine is called c:\Media\)
2. Setup the desired folder structure.
NOTE: I will use e.g.: Movies_Folder instead of C:\Media\Films\,
So you can input your own folder structure here.

3. Install all programs and apps listed above with the normal settings.

4. Setup uTorrent
utorrent1.jpg
See the image and change all directory's marked red to you folder structure.

5. Creating Scripts and batch files
The first script is actually a filebot script created by rednoah (U ROCK!)
In my case the usual script didn't work with the uTorrent %D string and so on.
Thats why I created my own script and needed the 32bit version of java.(Been working 3 days on it).

First Create a batch file and name it sorting.cmd
You can do this by right-click on a empty space inside windows explorer
and selecting NEW->TextDocument.
Then edit the textfile by right-click on it and select edit.
Inside this file put the following commands:

Code: Select all

 
rmdir /Q /S c:\Media\Downloads\Compleet
md c:\Media\Downloads\Compleet\
md c:\Media\Downloads\Compleet\ttemp\
xcopy c:\Media\Downloads\Temp\*.* c:\Media\Downloads\Compleet /s /q /c /y /e
filebot -script fn:utorrent-postprocess "c:/media/downloads/compleet" --output "C:/media/" --action move --conflict override -non-strict --def subtitles=n artwork=n  "movieFormat=/films/{n} {y}/{fn}" "seriesFormat=/series/{n}/{fn}" >> "C:/Media/filebot.log" 2>&1
 
As you can see, the filebot script will be started from within a cmd batch file.

NOTE: Change all the folders to your own folders created at the beginning.
In my case C:\Media\Downloads\Compleet\ is the Sorting_Folder
And so on...

Short explanation of the used commands:

Code: Select all

rmdir /Q /S c:\Media\Downloads\Compleet
Completely removes all subdirs and files

Code: Select all

 md c:\ blablaba 
is used to create a folder

Code: Select all

 Xcopy blablabla 
is used to copy all folders and files to a other location.


Save file as -> sorting.cmd
If it is still a txt file then rename it to sorting.cmd.
If that doesn't work follow this tutorial.

After that is done place te file inside the scriptFiles_Folder
In my case C:\Media\Scripts\Files\sorting.cmd

6. Download Invoke.vbs here
And place invoke.vbs into scriptsFiles_folder
In my case C:\Media\Scripts\Files\sorting.cmd

7. Setting Run commands in uTorrent Settings
utorrent2.jpg
Use the following code and put it in the run window of uTorrent:

Code: Select all

wscript c:\Media\Downloads\Script\Files\invoke.vbs c:\Media\Downloads\Script\Files\sorteren.cmd
Again, use the correct folders here! This is an example!

8. Setting up Download to Sorting Completed :D
You have now completed the biggest part.

This is it for now, if more people need help with setting up XBMC please let me know and i'll update this howto with that.
If everything has gone correctly you can now download a .torrent file and place it inside the Downloads_folder
When download is completed uTorrent will put the downloaded file into the Move_Folder
Then uTorrent will start the created script.
The script will copy all files from the Move_Folder to the Sorting_Folder
Then Filebot will sort the files and place them in the correct MOVIE/TV-Show folder.
The rest of de cmd batch file will clean the folders so they won't get cluttered.

Thats all! If You liked my Tutorial please donate to Rednoah! He made this possible!

Re: [HOWTO] Semi-Automated Download Mediacenter...

Posted: 10 Jan 2014, 18:09
by th3r00st3r
So if the script cleans up the directories, how are you seeding the files back?
What I need is a way to copy the currently finished download to it's destination, and seed it from the completed still until I choose to stop seeding (or by ratio). How can I achieve this?

Re: [HOWTO] Semi-Automated Download Mediacenter...

Posted: 11 Jan 2014, 04:10
by rednoah
This tutorial is outdated, but if you use --action copy the original files won't be touched.

Re: [HOWTO] Semi-Automated Download Mediacenter...

Posted: 01 Apr 2014, 14:45
by rnba
It works great except that I have Plex update every 30 minutes and it seems that if Plex is using the file or updating it it actually doesn't move or copy the file. Is there a way around this as I am sure XBMC works the same way. Below is how I have mine working, it worked once but then has not. Can you or someone let me know what is wrong with this, I am fairly new at t his and have read all of the posts about it.

filebot -script fn:utorrent-postprocess "M:\TV Shows\ZZZZZFinished" --output "M:\TV Shows" --action move --conflict override -non-strict --def subtitles=n artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" >> "M:\TV Shows\Logs\filebot.log" 2>&1

My Set up is as follows:
Running Win7 Pro
uTorrent v3.4 build 30660

uTorrent Downloads here: M:\TV Shows\ZZZDownloading
uTorrent moves finished here: M:\TV Shows\ZZZZZFinished

Have uTorrent run the script up aobe after finishes but it doesn't seem to be working now. Please help! Thanks.

Re: [HOWTO] Semi-Automated Download Mediacenter...

Posted: 01 Apr 2014, 20:32
by rednoah
1.
Use FileBot 4.0 and do -script fn:amc.

2.
I guess if the files are locked then they can't be moved. That can't be helped.

Re: [HOWTO] Semi-Automated Download Mediacenter...

Posted: 02 Apr 2014, 02:13
by rnba
So everything else in the script is correct? Do I need to restart uTorrent after I edit the script?

Re: [HOWTO] Semi-Automated Download Mediacenter...

Posted: 02 Apr 2014, 06:24
by rednoah
Only if it doesn't work.