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 only .ass format - as format that is capable of displaying solid background)
- 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 open but no new subtitles were downloaded
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 and TMP
- 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
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 only subtitle files generated during conversion, no old existing subtitles should be affected). 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 by repo:
https://bkiziuk.github.io/kodi-repo/stable/repository.bkiziuk/repository.bkiziuk-1.0.1.zip
It works only in Kodi 17.
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, I found out that texts encoded in CP1251 (Cyrillic - Russian and Bulgarian) are often read using CP1250 codec, which makes it unreadable. Fortunately new texts are mostly encoded in UTF-8. I'll try to find a better solution to this problem (actually, there is one, but doesn't support CP1250 at the moment) if this is proven to be a massive problem.
Any comments will be much appreciated. I already tested it briefly on Libreelec, Linux and Windows.
As current languages for UI and strings filtering include only English and Polish at the moment, help with other languages will also be greatly welcomed.