Ok this is roughly what I use. Remember I am not a coder. I cobbled this stuff together till it worked. Be prepared to cringe.
REM I NAMED THIS .BAT FILE EXTRACT2.BAT
REM The batch file is provided a full file path (including ext) in the form of variable %media_file_path% from an intital .bat file called EXTRACT.BAT which searches an entire directory (and sub directories) for .MPG, .MKV and .MP4 files. But you can use whatever media types you like... but CCExtractor will probably just abort on things like .AVI then proceed to Filebot.
set filenameWithoutExtension=%media_file_path:~0,-4%
echo *** %DATE% %TIME% *** >> H:\Subproc.log
echo Media Download: "%media_file_path%" >> H:\Subproc.log
REM IF NO COMMON ENGLISH .SRT SUBTITLES ALREADY EXSISTS THEN TRY CCEXTRACT OTHERWISE EXIT
if exist "%filenameWithoutExtension%".srt goto :EOF
if exist "%filenameWithoutExtension%".en.srt goto :EOF
if exist "%filenameWithoutExtension%".eng.srt goto :EOF
if exist "%filenameWithoutExtension%"_eng.srt goto :EOF
echo No Initial English .SRT Files available. Attempting to CCExtract >> H:\Subproc.log
echo %DATE% %TIME% Extracting closed captioning for %filenameWithoutExtension% >> H:\Subproc.log
"C:\Program Files (x86)\CCExtractor\ccextractorwinfull.exe" --gui_mode_reports -autoprogram -out=srt -bom -latin1 %media_file_path%
echo CCExtractor Error Level: %ERRORLEVEL% >> H:\Subproc.log
echo CCExtract Attempt Completed >> H:\Subproc.log
REM IF NO SUBTITLES EXTARCTED THEN TRY FILEBOT OTHERWISE EXIT
if exist "%filenameWithoutExtension%".srt goto :EOF
if exist "%filenameWithoutExtension%".en.srt goto :EOF
if exist "%filenameWithoutExtension%".eng.srt goto :EOF
if exist "%filenameWithoutExtension%"_eng.srt goto :EOF
echo No CCExtracted Subtitles for: "%filenameWithoutExtension%" >> H:\Subproc.log
echo %DATE% %TIME% Start Filebot Processing >> H:\Subproc.log
echo FILEBOT Filename sent : %media_file_path% >> H:\Subproc.log
C:\Filebot\filebot.exe -get-subtitles -r "%media_file_path%" -non-strict --lang en --output srt --encoding utf-8 --log all --log-file H:\Subproc.log
echo FILEBOT Error Level: %ERRORLEVEL% >> H:\Subproc.log
Echo FILEBOT Completed >> H:\Subproc.log
echo THIS IS THE COMPLETE END OF POST SUBTITLE PROCESSING SCRIPTS >> H:\Subproc.log
I call this type of .bat file with another one that contains the directory I want to look at for new media. I am sure there is a better way. An example of the code in this first .bat file is:
REM THIS .BAT FILE IS NAMED EXTRACT.BAT
for /R "F:\TV-Primary\Cold Case Files" %%f in (*.mp4, *.mkv, *.mpg) do extract2.bat "%%f"
exit
Of course you can use whatever directory you want.
Remember this is just an idea of how I personally do it. Terrible code I know. But it gets the job done for me. The actual files I use are even more messy than this with a bunch of logging code to help me figure out what I am doing wrong. But hopefully maybe this will point far more talented people out there in the right direction.
Oh, and make sure in Filebot you have setup your OpenSubtitles account info (you can do that from the GUI). I think from the CLI it is "filebot -script fn:configure". You only have to set it once. Remember the free OpenSubtitles account only allows for 200 subtitle downloads a day.