Subtitle woes

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Jorm
Posts: 20
Joined: 21 Apr 2021, 08:44

Subtitle woes

Post by Jorm »

Hi Folks,

New and testing FileBot, running it under Linux. I tested a few example movies to rename. I'm using this command line:

Code: Select all

filebot -rename *  --format '{plex.derive{" - $vf"}}' --output ./media  --action TEST --apply import --conflict index
However running into a few issues like this:

Code: Select all

[TEST] from [/home/jorm/Downloads/More.Than.a.Miracle.1967.DUBBED.1080p.WEBRip.x265-RARBG/More.Than.a.Miracle.1967.DUBBED.1080p.WEBRip.x265-RARBG.mp4] to [/home/jorm/Downloads/media/Movies/More Than a Miracle (1967)/More Than a Miracle (1967) - 1080p.mp4]
[TEST] from [/home/jorm/Downloads/More.Than.a.Miracle.1967.DUBBED.1080p.WEBRip.x265-RARBG/2_English.srt] to [/home/jorm/Downloads/media/Movies/More Than a Miracle (1967)/More Than a Miracle (1967) - 1080p.eng.srt]
[TEST] from [/home/jorm/Downloads/More.Than.a.Miracle.1967.DUBBED.1080p.WEBRip.x265-RARBG/3_English.srt] to [/home/jorm/Downloads/media/Movies/More Than a Miracle (1967)/More Than a Miracle (1967) - 1080p.eng.srt]
and

Code: Select all

[TEST] from [/home/jorm/Downloads/Night.in.Paradise.2020.DUBBED.1080p.WEBRip.x264-RARBG/10_English.srt] to [/home/jorm/Downloads/media/Movies/Night in Paradise (2020)/Night in Paradise (2020) - 1080p.eng.srt]
[TEST] from [/home/jorm/Downloads/Night.in.Paradise.2020.DUBBED.1080p.WEBRip.x264-RARBG/11_Spanish.srt] to [/home/jorm/Downloads/media/Movies/Night in Paradise (2020)/Night in Paradise (2020) - 1080p.spa.srt]
[TEST] from [/home/jorm/Downloads/Night.in.Paradise.2020.DUBBED.1080p.WEBRip.x264-RARBG/12_Spanish.srt] to [/home/jorm/Downloads/media/Movies/Night in Paradise (2020)/Night in Paradise (2020) - 1080p.spa.srt]
[TEST] from [/home/jorm/Downloads/Night.in.Paradise.2020.DUBBED.1080p.WEBRip.x264-RARBG/2_English.srt] to [/home/jorm/Downloads/media/Movies/Night in Paradise (2020)/Night in Paradise (2020) - 1080p.eng.srt]
Ok so far I understood that 2_English.srt is normal SLS subtitles, and 3_English is SDH subtitles, its for that for More.Than.a.Miracle. This is also pretty easy to see as the number of lines in 3_English is larger than in 2. So ideally this should be renamed like this:

Code: Select all

[TEST] from [/home/jorm/Downloads/More.Than.a.Miracle.1967.DUBBED.1080p.WEBRip.x265-RARBG/3_English.srt] to [/home/jorm/Downloads/media/Movies/More Than a Miracle (1967)/More Than a Miracle (1967) - 1080p.eng.sdh.srt]
in re to the two Spanish subtitles in the Night in Paradise, none of them are SDH but rather look to be two different translators, needless to say they should not be over written but question how do fix so it's named correctly, plex doesn't support many external files so easiest is probably to call one sdh or cc.

Second issue so that 10_English.srt is the normal SLS while the 2_English is the SDH in the Night In Paradise movie. Is there any way to detect it, what subtitle is what etc? Is there a way for FileBot to look in the subdirectories? To get this to work I had to copy the subtitles files to the movie directory. I know I could write some script to feed the --action parameter but then I can soon start to solve my specific needs with a python script so rather want to see if there is a way within FileBot.

Cheers Olof
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Subtitle woes

Post by rednoah »

FileBot does not this kind of subtitle naming by default. Notably, the amc script explicitly ignores badly named subtitle in subfolders because we know in advance that we probably won't be able to reliably process them. However, in this case, a simple -rename call, you're not processing subfolders because you didn't specify the -r flag.


:idea: If you have programming expertise, then you can extend your format and add lots of code to generate different file names for different subtitles, based on the varying file name and file content per subtitle file. The easiest solution would be to just preserve the original file name for subtitle files:

Code: Select all

--format "{f.subtitle ? fn : plex.name}"

:idea: If you choose not to process subtitle files at all, then --apply import should pick them up and copy them along as they are:

Code: Select all

--file-filter f.video



EDIT:

You can probably write your own poor mans SDH detection by counting certain pattern matches akin to this:
viewtopic.php?p=15388#p15388
:idea: Please read the FAQ and How to Request Help.
Post Reply