make sure last subtitle gets parsed

This commit is contained in:
j 2018-05-01 11:23:43 +02:00
parent 09b3779c47
commit eb7158dae1

View file

@ -80,6 +80,8 @@ def load(filename, offset=0):
return srt
data = data.replace('\r\n', '\n')
if not data.endswith('\n\n'):
data += '\n\n'
regexp = r'(\d\d:\d\d:\d\d[,.]\d\d\d)\s*?-->\s*?(\d\d:\d\d:\d\d[,.]\d\d\d).*?\n(.*?)\n\n'
srts = re.compile(regexp, re.DOTALL)
i = 0