Subtitles renaming script

Hi guys,



since yesterday and the arrival of Plex/Nine, I have to give my subtitles files the same name as the video filename, unless I can’t use them.

Since I have many of them, I don’t want to do it manually. Before starting writing a script myself, do you know one that already does that? Ideally, I’ll call it each time a new subtitle file is stored in a specific folder, but I can content myself with a script I can run each time I need it.



Thanks.

No answers, so I made my own.

If you want to use it, you have to set few things:

Line 191: Change the path to your TV show folder. Mine is “/Volumes/Capsule/Series/”.

Lines below 191: It is customized for my library, so it recognizes only shows I watch. If you want to add others, and I guess you would like to, you have to add three lines, resembling the following:


case /weeds/i {<br />
	$dir=$root."Weeds/";<br />
}


The first "weeds" is a key word we expect to find only in subtitles related to Weeds tv shows. The second "Weeds" is the name of the folder where weeds is stored. If you have troubles with some folder names (e.g. because of special characters), you can ask me some help.

To run the script you need to do few things:
[list=1]

[*]Download it :)
[*]Extract the renameSousTitresEN.pl from the archive (could not upload the script directly).
[*]Make it executable (enter

chmod +x renameSousTitresEN.pl

in the terminal)

Execute the script with all subtitle files you have. Example:


./renameSousTitresEN.pl weeds.6x01.ass 24.S08E07.zip 24.S08E17.srt


[*]Make a [donation](http://www.tinyurl.com/plexsub) if you like it (or like me, or both)
[*]Go on your couch and enjoy Plex with subtitles.
[/list]



Okay, since I'm not a perl hacker, the code may be optimized, but it works pretty fine here.
Enjoy, and don't hesitate to ask for help, even without donation :)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.