Release Subtitles Mangler - A comprehensive subtitle companion
#1
I started developing this addon mainly to get some practice in Python programming but also to improve movie watching experience for my family.
The main drive was to convert downloaded subtitles to display them with solid black background to improve subtitle readability.

The current list of implemented features include:

1) invoking subtitle search dialog at playback start taking into account local subtitle files availability:
- recognizes if there are subtitle files already downloaded or not (takes into account .ass format or optionally any supported subtitle format matching name of video being played) 
- recognizes 'noautosubs' file (per directory) and '.noautosubs' extension (per file) whose presence prevents subtitle search dialog from opening
- tries to identify if video file includes internal forced subtitles matching preferred language, and if so, doesn't open subtitle search dialog
- recognizes if subtitle search dialog was opened but no new subtitles were downloaded and asks if the dialog should be open again next time this video is played, which prevents constant opening subtitle search window each time a particular movie is played

2) detecting if subtitle file was downloaded locally and perform conversion
- gives ability to customize subtitle font color (foreground) and its background color and transparency, which makes subtitles more easy to read
- support subtitles input formats: microDVD, SubRip, MPL2, TMP and Substation Alpha
- allows to increase line spacing in 2-line texts, which prevents backgrounds overlap
- allows to filter subtitle contents based on various Regular Expression type criteria, which gives ability to remove unwanted texts, such as Hearing Impaired tags, advertisements, credits, etc.
- allows to increase subtitle display time to match at least minimum calculated time based on subtitle text length, taking into account start time of the next subtitle line
- allows to decrease subtitle display time to avoid next subtitle overlap
- allows to make a backup copy of converted subtitle file

3) detecting if video was removed from local storage and removing any related subtitle files located within Kodi's video media paths (takes into account subtitle files generated during conversion and optionally also any other subtitle files already residing on disk).
As I consider removing any files as potentially dangerous action, additional "simulation" option is enabled by default. Therefore it is possible to see in logs what files would be deleted.


Addon can be downloaded from Official Kodi Repo.

It works only in Kodi 17.6 and later as older versions lack some required API.

All logging can be directed to separate file. Debug level allows to log virtually every action the addon performs. Logs are rotated on daily basis. Two rotated copies are kept.

As a proper detection of file encoding seems to be a challenging task, the current implementation tries to guess encoding based on subtitle language. Fortunately new texts are mostly encoded in UTF-8. 

As current languages for UI include English, Polish, Hungarian, Czech, Slovak and German at the moment, help with other languages will also be greatly welcomed for both UI and filtering definitions.
RPi4; LibreElec
Reply


Messages In This Thread
Subtitles Mangler - A comprehensive subtitle companion - by bkiziuk - 2018-02-21, 20:13
Logout Mark Read Team Forum Stats Members Help
Subtitles Mangler - A comprehensive subtitle companion1