Kodi Community Forum

Full Version: SRT Subtitle File Cleaner
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, new here, but am a long time user of tiny media manager.

So, I use tmm to manage the movies and zoomplayer for playback.  When I use the "Search and download subtitles" function in tmm, it scrapes the subtitles from OpenSubtitles.org and puts them with the movie with a name like MyMovie.eng.srt  It works great, but them subtitles always have them pesky ads.  This tool which I have programmed (tmmIntercept) sits between tmm and zoomplayer, and temporarily removes the ads from the srt files before playing the movie.  It also (optionally) removes hearing impaired stuff like (cat meows).  The ad detection strings can be set in the configuration (cfg.txt) file, so new ads are simple to filter just by putting a new entry in the config.

Tested and works fine with tmm 3.1.10, and zoomplayer.  Most likely works fine with tmm 4 and other media players as well.

I wrote the program about a week ago, and have made some modifications since to fix errors, improve functionality, and improve ad filters.

There's a readme included in the zip archive with more details and configuration/setup instructions.

Last thing.  It's best to close zoomplayer (or whatever media player you're using) before editing the config file.

I used to do the ad and hi removal manually, but it eventually peed me off with the time wasted.  Now, it's painless, just scrape the subtitles and click play.

Hope it helps.

tmmIntercept -   Click the download link at the top right to download the full zip file
Thanks! I will put that into our additional information thread
(2020-11-02, 10:13)mlaggner Wrote: [ -> ]Thanks! I will put that into our additional information thread

Cheers and thank you.  Hopefully someone finds it useful.

Them srt ads were annoying the hell out of me.  It's not so much the one at the start, but the ad at the end of the movie is often during a dramatic scene.  Totally kills the mood when the good guy kills the bad guy in intense action scenario, then a romantic kiss with the cliche rescued lady has a NordVPN ad planted on it.
(2020-11-02, 10:46)troybowd Wrote: [ -> ]Them srt ads were annoying the hell out of me. 

Because hosting a subtitles providing website and its bandwidth as well as the work on its backbone that you are leeching of without any fees should all be done for free, right?
(2020-11-02, 11:33)Klojum Wrote: [ -> ]
(2020-11-02, 10:46)troybowd Wrote: [ -> ]Them srt ads were annoying the hell out of me. 

Because hosting a subtitles providing website and its bandwidth as well as the work on its backbone that you are leeching of without any fees should all be done for free, right?
Looks like this topic has already been discussed before here and I have nothing further to add.
Thanks for sharing the program!
Personally I am using Subtitle Edit's "Batch convert" command for this (especially via multiple replace setting).
The difference would be that it can edit subs permanently, can scan and process selected folders, and can handle all kinds of subs with more sophisticated options.
I can see how cleverly this program helps by sitting between tmm & media player and processing it temporarily, but I open video files more often with tmm closed and need the subs edited permanently.
(2020-11-02, 14:15)tars Wrote: [ -> ]Thanks for sharing the program!
Personally I am using Subtitle Edit's "Batch convert" command for this (especially via multiple replace setting).
The difference would be that it can edit subs permanently, can scan and process selected folders, and can handle all kinds of subs with more sophisticated options.
I can see how cleverly this program helps by sitting between tmm & media player and processing it temporarily, but I open video files more often with tmm closed and need the subs edited permanently.
No problem.  Thankyou for feedback.  This was just to serve the specific purpose of fire and forget.  i.e. beers are out and movie night is on, browse through movie library in tmm, scrape subs, then hit play.
I have updated tmmIntercept to correctly support multi-line HI (hearing impaired) removal.

Previously it could remove HI like:
[cat meows]
but it could not remove HI like:
[cat
meows]


Now it handles either case, and also multiple HI instances per subtitle.  So long as the leading qualifier is the first character on the line (excluding spaces) and the trailing qualifier is the last character on the line (excluding spaces), then all lines in the range between will now be properly removed.  Obviously leading qualifier must come before trailing qualifier too.

I didn't initially think multi-line HI was a thing, honestly I probably never took much notice before, but I've seen multi-line HI's appear a few times and not be removed in the old version of tmmIntercept.  Now, the new version removes them correctly.