From 979b8c43f72a0d65ac4ff014b9b96dd583ca5d44 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Thu, 27 Jun 2013 23:17:16 +0200 Subject: [PATCH] subtitle_sami: remove an extra space in the beginning --- lib/svtplay_dl/utils/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/svtplay_dl/utils/__init__.py b/lib/svtplay_dl/utils/__init__.py index 573c1be..c6efd7d 100644 --- a/lib/svtplay_dl/utils/__init__.py +++ b/lib/svtplay_dl/utils/__init__.py @@ -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: