1. Select a torrent
2. Assign a category to the download (animations, animated series, concerts, documentaries, documentary series, movies, music, shows)
3. On download completion, a batch file runs to check & convert any non-mp4 incoming files to mp4 format
What i need now is to b able to automatically send those files thru filebot, rename into plex format, acquire appropriate subtitle files, then transfer to 1 of 2 NAS drives, then update the plex libraries (which i'm still doing manually).
Here are the Filebot formats I'm currently using manually:
Animated Series
---------------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/Animated Series/' as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.tail}
----------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/Animations/' as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.name}/{plex.name}
--------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/Concerts/' as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.name}/{plex.name}
-------------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/Documentaries/' as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.name}/{plex.name}
------------------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/Documentary Series/' as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.tail}
------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/' + plex[0..1] as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.name} { fn.matchAll(/Donner Cut|Redux|DC|Director's Cut|Extended Edition|Producer's Cut|Ultimate Uncut|Special Edition/) }
--------
Code: Select all
{ ['Y:', 'Z:'] .collect{ it + '/TV Shows/' as File } .sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace } .last() }/{plex.tail}
Here's the current batch file iteration I'm using for the file conversion process:
Code: Select all
@echo off
set "rem[=rem/||(" & set "]rem=)"
%rem[%
batch file for handling downloaded movies and tv episodes.
name and category variables assigned by qbittorrent on download completion.
videoconverter file location calls and write destinations based on category variable.
converted files forwarded to filebot for renaming & upload to category-based directories within plex library.
%]rem%
set "logfile=d:\documents\torrent\conversionprogressreport.txt"
set "name=%1"
set "cat=%2"
set "folder=%3"
set "file=%4"
set "conv=d:\media\filebot"
set "dest=%conv%\%cat%\%name%"
%rem[%
set config_output=%userprofile%/media - this is rem'd awaiting multi-drive config info.
imported variables
%1 = filename -- %n in qbittorrent
%2 = category -- %l in qbittorrent
%3 = root path - %r in qbittorrent
%4 = content path - %f in qbittorrent
%]rem%
echo ****************************** >> %logfile%
echo %date% at %time% : conversion/deletion test. >> %logfile%
echo %date% at %time% : load video converter for %name% in %cat%. >> %logfile%
:convert
start /b /wait "video converter" c:\"program files (x86)"\avs4you\avsvideoconverter\avsvideoconverter.exe -a "d:\documents\conversions\%cat%.xml"
findstr "succeeded" c:\users\sm\appdata\roaming\avs4you\avsvideoconverter\avsvideoconverter.rpt
if %errorlevel%==0 (
echo %date% at %time% : video converter terminated successfully. >> %logfile%
goto filecheck
) else (
goto exit
)
goto exit
:filecheck
%rem[%
if converted file is found, delete old file.
if converted file not found, check old file.
if old file is corrupt, delete & replace.
if old file is not corrupt, recall converter
%]rem%
if exist %dest%.mp4
(
echo %date% at %time% : %dest%.mp4 file found; move (delete once this batch file is debugged) source. >> %logfile%
move /y %folder%.mkv d:\
echo %date% at %time% : source .mkv file moved(deleted). >> %logfile%
goto filebot
) else (
echo %date% at %time% : %dest%.mp4 file not found; restart converter. >> %logfile%
goto convert
)
:filebot
%rem[%
echo "run filebot"
filebot -script fn:amc --output %config_output% --action duplicate --conflict skip -non-strict --log-file amc.log --def skip extract=y unsorted=y music=y artwork=y clean=y plex=host:token:fbe9ujuypfyhktx1bwfu excludelist=excludes.txt subtitle=en ut_label=%cat% ut_title=%name% ut_file=%file% ut_dir=%folder%
%]rem%
:exit
Any assistance appreciated
