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

subtitle_tt cosmetics.

This commit is contained in:
Johan Andersson 2014-04-21 20:04:41 +02:00
parent 28bc0f3389
commit 8f715bd278

View File

@ -10,7 +10,7 @@ class subtitle():
self.subtitle = None
class subtitle_tt(subtitle):
def download(self):
def download(self, options):
self.subtitle = get_http_data(self.url)
i = 1
data = ""
@ -41,14 +41,14 @@ class subtitle_tt(subtitle):
if node.tail:
data += '%s\n\n' % node.tail.strip(' \t\n\r')
skip = False
filename = re.search(r"(.*)\.[a-z0-9]{2,3}$",options.output)
filename = re.search(r"(.*)\.[a-z0-9]{2,3}$", options.output)
if filename:
options.output = "%s.srt" % filename.group(1)
else:
options.output = "%s.srt" %options.output
options.output = "%s.srt" % options.output
log.info("Subtitle: %s",options.output)
fd = open(self.options.output, "w")
log.info("Subtitle: %s", options.output)
fd = open(options.output, "w")
if is_py2:
data = data.encode('utf8')
fd.write(data)