improve parser(handle empty subs)
This commit is contained in:
parent
cc8b42ebf4
commit
5ddf7970b9
1 changed files with 1 additions and 1 deletions
|
@ -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)\s*?(.+?)\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),
|
||||||
|
|
Loading…
Reference in a new issue