From eb7158dae193c4989b0e0fce7170dc3bc8995191 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 1 May 2018 11:23:43 +0200 Subject: [PATCH] make sure last subtitle gets parsed --- ox/srt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ox/srt.py b/ox/srt.py index 21905bc..5191a55 100644 --- a/ox/srt.py +++ b/ox/srt.py @@ -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