Closed tabs-mc closed 10 years ago
There is:
import pysrt
file = pysrt.SubRipFile()
sub = pysrt.SubRipItem(1, start='00:02:04,000', end='00:02:08,000', text="Hello World!")
file.append(sub)
file.save('my_movie.srt')
$ cat my_movie.srt
1
00:02:04,000 --> 00:02:08,000
Hello World!
Just take a look at the test suite, you'll see what the possibilities are.
This seems geared towards editing existing files. Is there a way to create a new .srt file in python with the existing functions?