>>> from subtitles import Subtitle >>> s = Subtitle() >>> s.loadSrtFile(path_to_srt) >>> s.shift(1000) # mseconds >>> srt = s.toSrt() #unicode string in srt format >>> s['3'] {'in': '00:00:05,800', out: '00:00:10,120', text: 'The last 100 years have been\na story of resistance on'} >>> text = unicode(s) # just the text without time and running number
This is a Bazaar branch. To get it use:
bzr branch http://oil21.org/~j/code/pysubtitles/
You can also find tarballs at http://oil21.org/~j/code/pysubtitles/download