UPDATE 09/11/14:So been playing with this a little more and have realised that I have over complicated things..
Now I just have the below script in uTorrent to run on completion, and so far so good, the script copies the files from the uTorrent folder to the destination to doesn't interrupt the torrent seeding.
I've also made it run hidden changing filebot to filebot.launcher.exe in the command, so if you are running the server and MC on the same machine it doesn't popup the command line version
I've also updated the music format, but still advise against using it because it is rubbish to be honest, and handles music file by file rather than looking at the album as a whole, which means a various artists album will copy to a folder per artist.
filebot.launcher.exe -script fn:amc --output "D:/Media1" --log-file amc.log --action copy --conflict override -non-strict --def "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" music=N artwork=n plex=localhost deleteAfterExtract=n clean=n excludeList=amc-input.txt "seriesFormat=D:/Media1/TV/{n}/{'S'+s}/{fn}" "animeFormat=D:/Media1/New Films/{n}/{fn}" "movieFormat=D:/Media1/New Films/{n} {y}/{fn}" "musicFormat=D:/Media1/Music/New/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}"
I'll leave the rest below in case anyone wants to reference it.
AIM:A script that once uTorrent finishes downloading, it is automatically run to extract and sort the media files in to the correct folders so that you can use specific media folders in plex rather than having to use "Home Movies".
This script is setup to work with Plex and assumes Plex server is running on the local PC, however if you don't have Plex it will still run fine (it's only 1 flag in the filebot script) This can also be changed to notify XBMC, if there is demand for it I'll add variables at the top to control location of server and XMBC/Plex choices? Although not the most difficult thing to work out.
Note: If you setup an RSS feed in uTorrent, you can get it to automatically download TV episodes when they are availble, and they will just appear in your Plex library without you needing to do anything! This is really easy to setup - Google it!Requirements:Filebot needs to be installed, this deals with the extract and multimedia sorting, everything else in this script is to make sure uTorrent doesn't have a fit and to then save duplication as a result!
Optional: Plex Media Server - This is designed around Plex, although will still work if you don't have it!
What it does:- Uses variables, so is easy to configure
- Checks to see if the script is already running, if so waits until it's not, otherwise it gets confused
- Stores a directory listing from the torrent downloads folder so that it doesn't process the same file twice
- Makes a duplicate of only the file(s) to process, so that uTorrent can continue to seed the original and doesn't either lock the file causing an error or have a fit when it can't find the data
- Runs filebot which extracts and splits Movies/TV/Anime/Music to different folders as specified, removing unneeded files such as samples, the below also strips subtitles, although I can probably re-add if demand calls for it!
- Note: Music is disabled below as I don't like how it categorises, but you can enable by changing to music=Y
- Automatically notifies Plex Server of the update
- The pause at the end can be removed, I just like to see what has run, and is useful for error checking
The Batch Script (Save as "filebotscript.bat"):echo off
cls
:: Music is disabled but have included a location if you want to enable in the filebot script, however I don't like how it organises music.
:: Variables should not have a slash on the end - the variables have an explanation below.
:: Variables shoud avoid using spaces - only because I don't use them and haven't added relevant
:: READY - DIR where files are downloaded to
:: FILMS TV MUSIC ANIME - These are the media locations
:: CONFIGURABLE BACK SLASH VARIABLES LISTED BELOW - NO SPACES IN FILENAMES
:: AUTOMATEDATA - A location that can be used for storing file lists to stop duplication
set AUTOMATEDATA=D:\Automatedata
:: COMPLETETORRENT - DIR where files are downloaded to in uTorrent
set COMPLETETORRENT=D:\Downloads\Complete
:: TEMPMEDIA - temporary folder where a copy of your downloads is made so that uTorrent doesn't lock files (will only copy new files)
set TEMPMEDIA=D:\Downloads\Temp
:: MEDIA - The main directory of your media - I don't think this really matters as media locations are defined below, and duplicate list is not used in filebot
set MEDIA=D:\Media1
:: CONFIGURABLE FORWARD SLASH VARIABLES LISTED BELOW
set FILMS=D:/Media1/New Films
set TV=D:/Media1/TV
set MUSIC=D:/Media1/Music/New
set ANIME=D:/Media1/Anime
echo.
echo Create automated data and temp folders - ignore already exists errors
echo #################################################################
echo.
mkdir %AUTOMATEDATA%
mkdir %TEMPMEDIA%
echo.
echo Check if script is already running
echo #################################################################
echo.
:RUNNINGCHECK
if exist %AUTOMATEDATA%\running.txt goto PLEASEHOLD
GOTO:NEXTPLEASE
:PLEASEHOLD
REM Hold for 30 seconds then re-check
echo script running... waiting 30 seconds for re-try
ping 1.1.1.1 /n 1 /w 30000 > NUL
GOTO:RUNNINGCHECK
:NEXTPLEASE
REM Create a file to flag script is running and proceed to run the rest of the script.
echo This file just shows script is running, delete file if script is not running > %AUTOMATEDATA%\running.txt
echo.
echo Get Dir listing and save to temporary text file so next time the same files are not copied
echo #################################################################
echo.
dir "%COMPLETETORRENT%" /b > "%AUTOMATEDATA%\templist.txt"
echo.
echo Copy files to safe "TempTorrent" location excluding those present last time this was run
echo #################################################################
echo.
XCOPY "%COMPLETETORRENT%" "%TEMPMEDIA%" /C /S /H /Y /J /Exclude:%AUTOMATEDATA%\done.txt
REM Below line removed as date redundant following addition of exclude list, date string converts to US date format.
REM XCOPY "%COMPLETETORRENT%" "%TEMPMEDIA%" /C /S /H /Y /J /D:%date:~3,2%-%date:~0,2%-%date:~8,2%
echo.
echo Delete old list and replace with temp list.
echo #################################################################
echo.
del "%AUTOMATEDATA%\done.txt"
ren "%AUTOMATEDATA%\templist.txt" done.txt
echo.
echo Run Filebot - unrecognised files will remain in the "TempTorrent" location
echo #################################################################
echo.
:: If using XBMC, replace plex below with XBMC
"C:\Program Files\FileBot\filebot" -script fn:amc --output "%MEDIA%" --log-file amc.log --action move --conflict override -non-strict "%TEMPMEDIA%" --def music=N artwork=n plex=localhost deleteAfterExtract=y clean=y "seriesFormat=%TV%/{n}/{'S'+s}/{fn}" "animeFormat=%ANIME%/{n}/{fn}" "movieFormat=%FILMS%/{n} {y}/{fn}" "musicFormat=%MUSIC%/{n}/{fn}"
REM Delete running indicator file
del "%AUTOMATEDATA%\running.txt"
pause
This is the old script for reference:
echo off
cls
REM Music is disabled but have included a location if you want to enable in the filebot script, however I don't like how it organises music.
REM Variables should not have a slash on the end - the variables have an explanation below.
REM GENERAL - A location that can be used for storing file lists to stop duplication
REM READY - DIR where files are downloaded to
REM COMPLETE - secondary folder where a copy is made so that uTorrent doesn't lock files
REM MEDIA - The main directory of your media - I don't think this really matters as media locations are defined below, and duplicate list is not used in filebot
REM FILMS TV MUSIC ANIME - These are the media locations
REM CONFIGURABLE BACK SLASH VARIABLES LISTED BELOW
set GENERAL=D:\s1
set READY=D:\Downloads\Ready
set COMPLETE=D:\Downloads\Complete
set MEDIA=D:\Media1
REM CONFIGURABLE FORWARD SLASH VARIABLES LISTED BELOW
set FILMS=D:/Media1/New Films
set TV=D:/Media1/TV
set MUSIC=D:/Media1/Music/New
set ANIME=D:/Media1/Anime
echo.
echo Check if script is already running
echo #################################################################
echo.
:RUNNINGCHECK
if exist %GENERAL%\running.txt goto PLEASEHOLD
GOTO:NEXTPLEASE
:PLEASEHOLD
REM Hold for 30 seconds then re-check
echo script running... waiting 30 seconds for re-try
ping 1.1.1.1 /n 1 /w 30000 > NUL
GOTO:RUNNINGCHECK
:NEXTPLEASE
REM Create a file to flag script is running and proceed to run the rest of the script.
echo This file just shows script is running, delete file if script is not running > %GENERAL%\running.txt
echo.
echo Get Dir listing and save to temporary text file so next time the same files are not copied
echo #################################################################
echo.
dir "%READY%" /b > %GENERAL%\templist.txt
echo.
echo Copy files to safe "Ready" location excluding those present last time this was run
echo #################################################################
echo.
XCOPY %READY% %COMPLETE% /C /S /H /Y /J /Exclude:%GENERAL%\done.txt
echo.
echo Delete old list and replace with temp list.
echo #################################################################
echo.
del %GENERAL%\done.txt
ren %GENERAL%\templist.txt done.txt
echo.
echo Run Filebot - unrecognised files will remain in the "Ready" location
echo #################################################################
echo.
"C:\Program Files\FileBot\filebot" -script fn:amc --output "%MEDIA%" --log-file amc.log --action move --conflict override -non-strict "%COMPLETE%" --def music=N artwork=n plex=localhost deleteAfterExtract=y clean=y "seriesFormat=%TV%/{n}/{'S'+s}/{fn}" "animeFormat=%ANIME%/{n}/{fn}" "movieFormat=%FILMS%/{n} {y}/{fn}" "musicFormat=%MUSIC%/{n}/{fn}"
REM Delete running indicator file
del %GENERAL%\running.txt
pause
This is just an admin script that resets validation and running indicators in case something went wrong, you shouldn't need this with the version of the script above, unless you exit the script before it completes.
echo off
cls
:: AUTOMATEDATA - A location that can be used for storing file lists to stop duplication
REM This will clear done list and re run normal process
set AUTOMATEDATA=D:\Automatedata
echo none > "%AUTOMATEDATA%\done.txt"
REM Delete running indicator file
del "%AUTOMATEDATA%\running.txt"
filebotscript.bat
uTorrent Settings: