Can someone help me with an advice for auto renaming subtitles?

Hello,

Please tell me the easiest way to rename a subtitle from:

Subtitle.srt
to
Subtitle.ro.srt

I need a plug-in or something to do this automatically.

I’ve tried srt2utf-8 but it only creates a copy of the original subtitle and rename it like this: Subtitle.srt.Srt2Utf-8 so I guess that’s the backup one.

Thanks!

Doesn’t SubZero do that already when it fetches subtitles?

Filebot does it also when you use the {plex} renaming pattern.

Subzero download the subtitle form open-subtitle for example and indeed it rename it but that’s not every time the correct subtitle. I need something that renames my local subtitle that already exists so Plex can see the language and show diacritics.

The language code in the subtitle’s file name has nothing to do with diacritics showing up.
That solely depends on the ‘text encoding’ within the file.
And the text encoding cannot be changed by a simple renaming procedure.

If you are on Windows, I recommend Subtitle Edit
It has a ‘batch mode’ where it scans a whole folder (or drive) and converts all srt files to UTF-8.

OK, let me explain this: All my subtitles are in my native language and are working well on every player. They are working on Plex too but without diacritics. If I manually rename any of this subtitle from subtitle.srt to subtitle.ro.srt (where ro is the Romanian country code) then Plex shows diacritics and everything is ok. Problem is that I don’t want to keep renaming manually this subtitles and I need something that add “.ro” before extension automatically. Hope you understand now.

This is very weird. I have never heard of such a ‘feature’ in Plex.
What type of Plex clients are you using?

And it doesn’t change the fact that srt subtitles have to be encoded in UTF-8, for them to work in any Plex client. So I recommend you to use SubtitleEdit in any case.

I use the latest version of plex on any device. Why should I use SubtitleEdit? I just told you I need something to rename the file not to edit it and also I need something to do this automatically not manually.

Just download a romanian subtitle for a movie you have and play it and you will see that some letters like “ș” or “ț” will be replaced with some sort of symbols but if you then rename the subtitle adding “.ro” before the “.srt” extension then everything will be ok.

There are tons of posts like this on Plex forum, I’m impressed that you did not read about something like this before.

Even they are explaining how to do i there https://support.plex.tv/articles/200471133-adding-local-subtitles-to-your-media/

I wrote SRT2UTF-8, and can confirm what @OttoKerner says…

Sorry, but you are wrong in concluding, that a simple rename fixes anything!

I edited the SRT2UTF-8 code and added the option to create a new file for the converted text as subtitle.languageCode.extension. Now everything works great and automatically. This is all I wanted. If it’s your code you should add something like that:

def CopyOriginal(file, sMyLang):
if Prefs[‘ConversionResult’] == ‘Create a new file as originalFilename.languageCode.subtitleExtension’:
iCounter = 1
fileName, fileExtension = os.path.splitext(file)
sTarget = fileName + ‘.’ + sMyLang + fileExtension
Log.Debug(‘Making a copy of the original file as %s’ %(sTarget))
shutil.copyfile(file, sTarget)
return sTarget
else:
return file

2 Likes

@Robitza salut
Wich file did you edit to solve that?
Thanks

hi, can you please show me how you did that. i also want to autorename my subtitles. I would appreciate it so much. Thank you!