Do not download subtitles if folder already contains subtitles

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
gaoden12
Posts: 1
Joined: 09 Aug 2019, 08:25

Do not download subtitles if folder already contains subtitles

Post by gaoden12 » 09 Aug 2019, 08:27

HI all,
Question on subtitles,
Is there a way to set if the directory has subtitles, not to download from opensubtitles.
Second question, is there a way to change the srt file if exists to .eng.srt?

Thanks for you help.

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

Re: The directory has subtitles

Post by rednoah » 09 Aug 2019, 12:11

:!: I will assume that you're using the CLI, and not the GUI.


gaoden12 wrote:
09 Aug 2019, 08:27
Is there a way to set if the directory has subtitles, not to download from opensubtitles.
Yes, the use --file-filter option to include / exclude input files from processing:

Code: Select all

filebot -r . --file-filter '!folder.listFiles{ it.subtitle }' ...

gaoden12 wrote:
09 Aug 2019, 08:27
Second question, is there a way to change the srt file if exists to .eng.srt?
Yes, use --db file to process generic files and use --file-filter option to include / exclude input files from processing:

Code: Select all

filebot -rename --db file -r . --file-filter 'any{ f.subtitle && !lang }{ true }' --format '{fn}.eng'

:!: {lang} is never undefined, and throws an error instead of returning a null or undefined value, so we need to use any{}... to work around that, to explicitly include files where {lang} fails.
:idea: Please read the FAQ and How to Request Help.

Post Reply