1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

Ignores unexpected empty lines in subtitle format

This commit is contained in:
Kristoffer Hallqvist 2018-09-30 17:43:25 +02:00 committed by Johan Andersson
parent 8c19f96e46
commit 1d716d5963

View File

@ -274,7 +274,9 @@ class subtitle(object):
if n:
itmes.append(n)
else:
if len(subs) > 1 and itmes[1] == subs[-1][1]: # This will happen when there is two sections in file
if len(subs) > 1 and len(itmes) < 2: #Ignore empty lines in unexpected places
pass
elif len(subs) > 1 and itmes[1] == subs[-1][1]: # This will happen when there are two sections in file
ha = strdate(subs[-1][0])
ha3 = strdate(itmes[0])
second = str2sec(ha3.group(2)) + time