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

subtitle_sami: remove an extra space in the beginning

This commit is contained in:
Johan Andersson 2013-06-27 23:17:16 +02:00
parent 4c858f173f
commit 979b8c43f7

View File

@ -172,14 +172,17 @@ def subtitle_sami(options, data):
tree = ET.XML(data)
subt = tree.find("Font")
subs = ""
n = 0
for i in subt.getiterator():
if i.tag == "Subtitle":
if i.attrib["SpotNumber"] == 1:
n = i.attrib["SpotNumber"]
if i.attrib["SpotNumber"] == "1":
subs += "%s\n%s --> %s\n" % (i.attrib["SpotNumber"], i.attrib["TimeIn"], i.attrib["TimeOut"])
else:
subs += "\n%s\n%s --> %s\n" % (i.attrib["SpotNumber"], i.attrib["TimeIn"], i.attrib["TimeOut"])
else:
subs += "%s\n" % i.text
if n > 0:
subs += "%s\n" % i.text
filename = re.search(r"(.*)\.[a-z0-9]{2,3}$", options.output)
if filename: