mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 04:05:39 +01:00
smi: check if data is empty
This commit is contained in:
parent
4d634dc323
commit
7950e06e0d
@ -113,12 +113,15 @@ class subtitle(object):
|
||||
TAG_RE = re.compile(r'<[^>]+>')
|
||||
bad_char = re.compile(r'\x96')
|
||||
for i in ssubdata.readlines():
|
||||
i = i.rstrip()
|
||||
sync = re.search(r"<SYNC Start=(\d+)>", i)
|
||||
if sync:
|
||||
if int(sync.group(1)) != int(timea):
|
||||
if data != " \r":
|
||||
if data and data != " ":
|
||||
subs += "%s\n%s --> %s\n" % (number, timestr(timea), timestr(sync.group(1)))
|
||||
text = "%s\n" % TAG_RE.sub('', data.replace("<br>", "\n"))
|
||||
if text[len(text)-2] != "\n":
|
||||
text += "\n"
|
||||
subs += text
|
||||
number += 1
|
||||
timea = sync.group(1)
|
||||
|
Loading…
Reference in New Issue
Block a user