plex-subtitles-normalizer
v0.3.0
Published
CLI tool to fix subtitles needed by Plex Media Center
Readme
Plex Subtitles Normalizer CLI
This CLI tool guarantee that SRT files have the proper format, including empty lines.
As today, PLEX Player has issues when:
- breaklines (aka
\n) are added at the top of the file before the first block - empty blocks with a single breakline.
This breaks subtitles, specially when casting them to Chromecast.
Installation
This tool requires nodejs, and should installed as globals.
npm install plex-subtitles-normalizer --globalHow to Use
$ cd path/to/Movies
$ psnBy calling psn in a folder, it looks for any file with .srt extension, analyzing the file looking for invalid formats, if the file has any, it will create a backup of the file (by adding the .bak extension), and it will override the original file with the correct format.
Advanced Options
Backups
You can pass an option to avoid creating backup files, although it is not recommended:
$ psn --no-backupIf something weird happen, you can always restore the backup, or simply use the backup as the original source:
$ psn --from-backupEncoding
You can also select the encoding, by default latin1 will be used. The tool will automatically detect some encoding issues, but if you find something weird, you can try to use an alternative encoding from iconv-lite, for example, you can use Big5 for chinese:
$ psn --from-backup --encoding Big5Custom path
You can customize the pattern to search for subtitles:
$ psn --pattern **/*.srt