Forced Subtitles Help

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Charllie62
Posts: 6
Joined: 05 Apr 2025, 11:31

Forced Subtitles Help

Post by Charllie62 »

Hi all

I am looking for help if possible.

I have been using Filebot for years, renaming the tv files to appear like this "The Night Agent - S02E02 - Disconnected".

I am no good with scripting so was wondering if someone could help me with a custom script. I would like to rename the files as above but also link the forced subtitles only to each episode. By this i mean any subtitles that are ain a foreign language for certain parts of the show.

I have linked my opensubtitles account to Filebot but no good with scripting. I would also like to do the same with forced subtitles with movies.

I am not being lazy and tried googling but cant find anything that i fully understand to do this.

Also, secondly, i have a plex account and from my googling, i understand that you can link Filebot and Plex, therefore if anyone has any good links to set this up then i would appreciate sharing them.

Thanks in advance.

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

Re: Forced Subtitles Help

Post by rednoah »

:idea: A video file and a set of subtitle files are considered "linked" if the have the same base name:

Code: Select all

Avatar.mkv
Avatar.eng.srt
Avatar.eng.forced.srt
** Avatar.eng.forced.srt would be a forced subtitles file in this example


Charllie62 wrote: 31 Aug 2025, 10:34 I would like to rename the files as above but also link the forced subtitles only to each episode. By this i mean any subtitles that are ain a foreign language for certain parts of the show.
I don't know what you're trying to do. Can you describe in detail what you are trying to achieve and why? What would add much needed context and clarity to the topic at hand.

Maybe you mean one of these things?
:?: A. Fetch subtitles - specifically forced subtitles - after renaming?
:?: B. Rename video files and subtitles files, but only the forced subtitles, delete the normal subtitles instead?
:?: C. Rename video files and then merge external subtitle files - only force subtitles though - into the target MKV file?
:?: D. Maybe something else entirely?


Charllie62 wrote: 31 Aug 2025, 10:34 i understand that you can link Filebot and Plex, therefore if anyone has any good links to set this up then i would appreciate sharing
FileBot and Plex cannot "link" in the sense of talking to each other. FileBot can however be configured to send Plex a simple one-way message to instruct Plex to rescan a given folder. See Custom Post-Processing Scripts › Refresh Plex for details.
:idea: Please read the FAQ and How to Request Help.
Charllie62
Posts: 6
Joined: 05 Apr 2025, 11:31

Re: Forced Subtitles Help

Post by Charllie62 »

Hi Rednoah

Thank you for the reply. Apologies if i did not explain myself properly.

The following 2 suggestions are what i am looking for.

A. Fetch subtitles - specifically forced subtitles - after renaming?
After renaming the files in Filebot, i would like it to fetch specifically forced subtitles, no others

C. Rename video files and then merge external subtitle files - only force subtitles though - into the target MKV file?
I didn't know this could be done by Filebot so this would be a great option also.

Basically, i am looking to rename my files and then have the forced subtitles automatically showing when i view the video in Plex. Not have to go looking for them indiviually within Plex when i come to watch each episode.

Hope i have explained my self better.

Thanks

Charllie
Charllie62
Posts: 6
Joined: 05 Apr 2025, 11:31

Re: Forced Subtitles Help

Post by Charllie62 »

Hi Rednoah

Thank you, and apologies if i am being dull here.

Currently, the format used to rename my files is as follows:

{n} - {sxe} - {t}

How do i change that to automatically link the forced subtitle.

I am really sorry if coming across useless, but this stuff is over my head. I know i can search for forced subtitles in Filebot in the subtitle section and then download and link it to the file. I just want a format that does this automatically when i rename the files. Hope that makes sense. Scripting is not my thing.

Thanks

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

Re: Forced Subtitles Help

Post by rednoah »

:idea: The easy solution would be to just drop the "forced subtitles" requirement. Might be as easy as enabling the Fetch subtitle files feature.


:idea: If you were use the Subtitle feature then you could just drop your files and then select the subtitle files you want manually, only the -forced ones if that is what you choose:





:arrow: Alternatively, if you must have forced subtitles only, then a Custom Post-Processing Scripts like this might do the trick. This will download subtitles as usual but specifically select only subtitles that contain forced in the name:

Groovy: Select all

{ source, target ->
	getSubtitles target, 'en', strict: false, filter: { it =~ /forced/ }
}
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24111
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Forced Subtitles Help

Post by rednoah »

Charllie62 wrote: 31 Aug 2025, 11:37 Currently, the format used to rename my files is as follows:

{n} - {sxe} - {t}

How do i change that to automatically link the forced subtitle.
:?: What does "link" mean exactly? The format above will rename files and thus produce "linked" subtitles like so:

Code: Select all

The Night Agent - S02E02 - Disconnected.mkv
The Night Agent - S02E02 - Disconnected.srt
:idea: By "linked" we usually mean that video files and subtitles files - after renaming - have the same base name. The term "linked" is notably completely unrelated to downloading subtitles.


:idea: A video file / subtitle fail pair being "linked-by-name" is enough for Plex to pick up the subtitles. I would not merge them into the MKV file unless I had a better reason. Merge video and external subtitles can serve as a starting point if you must embed your external subtitles into the MKV file for some reason.
:idea: Please read the FAQ and How to Request Help.
Charllie62
Posts: 6
Joined: 05 Apr 2025, 11:31

Re: Forced Subtitles Help

Post by Charllie62 »

Hi Rednoah

That is just want i am looking for, i have tried both options and they work for me.

I apologise for not explaining myself properly and grateful you stuck with me.

Thank you so much for your help. I really appreciate it.

Thanks

Charllie
Post Reply