1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 12:15:40 +01:00

sami: they started to use : instead of ,

This commit is contained in:
Johan Andersson 2014-12-15 22:19:58 +01:00
parent 2aa0fc3e84
commit 7d9d2c7680

View File

@ -84,10 +84,11 @@ class subtitle(object):
for i in subt.getiterator(): for i in subt.getiterator():
if i.tag == "Subtitle": if i.tag == "Subtitle":
n = i.attrib["SpotNumber"] n = i.attrib["SpotNumber"]
if i.attrib["SpotNumber"] == "1": if i.attrib["SpotNumber"] == "1":
subs += "%s\n%s --> %s\n" % (i.attrib["SpotNumber"], i.attrib["TimeIn"], i.attrib["TimeOut"]) subs += "%s\n%s --> %s\n" % (i.attrib["SpotNumber"], timecolon(i.attrib["TimeIn"]), timecolon(i.attrib["TimeOut"]))
else: else:
subs += "\n%s\n%s --> %s\n" % (i.attrib["SpotNumber"], i.attrib["TimeIn"], i.attrib["TimeOut"]) subs += "\n%s\n%s --> %s\n" % (i.attrib["SpotNumber"], timecolon(i.attrib["TimeIn"]), timecolon(i.attrib["TimeOut"]))
else: else:
if int(n) > 0: if int(n) > 0:
subs += "%s\n" % i.text subs += "%s\n" % i.text
@ -176,6 +177,10 @@ def timestr(msec):
output = "%02d:%02d:%05.2f" % (hours, minutes, sec) output = "%02d:%02d:%05.2f" % (hours, minutes, sec)
return output.replace(".", ",") return output.replace(".", ",")
def timecolon(data):
match = re.search("(\d+:\d+:\d+):(\d+)", data)
return "%s,%s" % (match.group(1), match.group(2))
def norm(name): def norm(name):
if name[0] == "{": if name[0] == "{":
_, tag = name[1:].split("}") _, tag = name[1:].split("}")