mirror of
https://github.com/MatomoCamp/recording-subtitles.git
synced 2024-09-19 16:03:52 +02:00
Merge branch 'main' of github.com:MatomoCamp/recording-subtitles
This commit is contained in:
commit
8d357c3211
1 changed files with 3 additions and 3 deletions
|
@ -13,13 +13,13 @@ replacements = {
|
|||
"Mitoma": "Matomo",
|
||||
"Matoma": "Matomo",
|
||||
"matoma": "matomo",
|
||||
"Matomo Camp":"MatomoCamp"
|
||||
"Matomo Camp": "MatomoCamp",
|
||||
"Big Blue Button": "BigBlueButton"
|
||||
}
|
||||
search_strings = [re.escape(k) for k in sorted(replacements, key=len, reverse=True)]
|
||||
pattern = re.compile("|".join(search_strings), flags=re.DOTALL)
|
||||
|
||||
for srt_file in current_dir.glob("**/*.srt"):
|
||||
text = srt_file.read_text()
|
||||
fixed_text=pattern.sub(lambda x: replacements[x.group(0)], text)
|
||||
fixed_text = pattern.sub(lambda x: replacements[x.group(0)], text)
|
||||
srt_file.write_text(fixed_text)
|
||||
|
||||
|
|
Loading…
Reference in a new issue