brianspilner01 / media-server-scripts

84 stars 18 forks source link

wrong srta/srtª delete #4

Closed altendorfme closed 3 years ago

altendorfme commented 3 years ago

It's filtering and erasing that has "Srta" or "srtª" (pt-br) = Ms (english)

sub-clean.sh succesfully processed /storage/xyz.srt
The following lines were removed:
8
00:03:07,521 --> 00:03:10,023
- Srta. Jackson!
- Como se sente?
brianspilner01 commented 3 years ago

I'm sorry, I only developed and tested the regex for English subs. I think other languages would be beyond the scope and trying to apply the same regex to all of them would make it ineffective. I welcome and encourage you to modify it for your own use cases, simply change REGEX_TO_REMOVE. You will see one of the components (each seperated by a pipe |) is just 'srt' about halfway along, removing that will fix this specific issue. I'd recommend looking through some of the other components (mainly the shorter ones) that could be contained in words in your language to avoid similar future issues.