I have a subtitle of a two-digit milliseconds, how do I get a valid three-digit milliseconds?
example before
1
00:00:06,10 --> 00:00:08,05.
Let go, let go.
2
00:00:24,21 --> 00:00:29,24.
This is Dateline: Springfield.
3
00:00:30,08 --> 00:00:32,18.
Homer and Marge were
4
00:00:40,03 --> 00:00:45,08.
high school sweethearts.
5
00:00:45,13 --> 00:00:49,05.
She saved me from a dateless prom.
after , using Subtitle Edit It gives you a valid milliseconds
1
00:00:06,417 --> 00:00:08,208
Let go, let go.
2
00:00:24,875 --> 00:00:29,999
This is Dateline: Springfield.
3
00:00:30,333 --> 00:00:32,750
Homer and Marge were
4
00:00:40,125 --> 00:00:45,333
high school sweethearts.
5
00:00:45,542 --> 00:00:49,208
She saved me from a dateless prom.
I used a script pysubs2 https://pypi.org/project/pysubs2/
import pysubs2
subs = pysubs2.load("my_subtitles.srt", encoding="utf-8")
subs.shift(s=0.0)
for line in subs:
line.text = "{\\be1}" + line.text
subs.save("Output_subtitles.srt")
Only supplies a zero at the end of the timestamp
00:00:06,10 --> 00:00:08,05 to 00:00:06,100 --> 00:00:08,050
Note I know code provides seconds and milliseconds
But all I want is to calculate the duration milliseconds
like use Subtitle Edit
What you want can be done with regular expression and re.sub from the standard python library.