ignore anything after timecodes in srt, fixes #996

This commit is contained in:
j 2012-09-21 11:48:02 +02:00
parent 1522f870b7
commit 2d1ad2785d

View file

@ -75,7 +75,7 @@ def load(filename, offset=0):
return srt return srt
data = data.replace('\r\n', '\n') data = data.replace('\r\n', '\n')
srts = re.compile('(\d\d:\d\d:\d\d[,.]\d\d\d)\s*?-->\s*?(\d\d:\d\d:\d\d[,.]\d\d\d)\s*?(.*?)\n\n', re.DOTALL) srts = re.compile('(\d\d:\d\d:\d\d[,.]\d\d\d)\s*?-->\s*?(\d\d:\d\d:\d\d[,.]\d\d\d).*?\n(.*?)\n\n', re.DOTALL)
i = 0 i = 0
for s in srts.findall(data): for s in srts.findall(data):
_s = {'id': str(i), _s = {'id': str(i),