handle srts with empty subs

This commit is contained in:
j 2012-03-07 18:59:02 +01:00
parent 5ddf7970b9
commit b76bb80577

View file

@ -75,7 +75,7 @@ def load(filename, offset=0):
return srt
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)\s*?(.*?)\n\n', re.DOTALL)
i = 0
for s in srts.findall(data):
_s = {'id': str(i),