make sure last subtitle gets parsed
This commit is contained in:
parent
09b3779c47
commit
eb7158dae1
1 changed files with 2 additions and 0 deletions
|
@ -80,6 +80,8 @@ def load(filename, offset=0):
|
||||||
return srt
|
return srt
|
||||||
|
|
||||||
data = data.replace('\r\n', '\n')
|
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'
|
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)
|
srts = re.compile(regexp, re.DOTALL)
|
||||||
i = 0
|
i = 0
|
||||||
|
|
Loading…
Reference in a new issue