1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

output: use the right slash for the right platform

fixes #251
This commit is contained in:
Johan Andersson 2015-08-24 23:02:18 +02:00
parent ea014f27d2
commit 5a54105ccc
8 changed files with 8 additions and 12 deletions

View File

@ -139,10 +139,6 @@ def filename(options, stream):
# output is a directory
options.output = os.path.join(options.output, filenamify(title_tag))
if platform.system() == "Windows":
# ugly hack. replace \ with / or add extra \ because c:\test\kalle.flv will add c:_tab_est\kalle.flv
if options.output and options.output.find("\\") > 0:
options.output = options.output.replace("\\", "/")
return True
def output(options, extention="mp4", openfd=True):

View File

@ -78,7 +78,7 @@ class Disney(Service, OpenGraphThumbMixin):
title = "%s-%s" % (title, options.service)
title = filenamify(title)
if len(directory):
options.output = "%s/%s" % (directory, title)
options.output = os.path.join(directory, title)
else:
options.output = title
@ -104,7 +104,7 @@ class Disney(Service, OpenGraphThumbMixin):
title = "%s-%s" % (name, options.service)
title = filenamify(title)
if len(directory):
options.output = "%s/%s" % (directory, title)
options.output = os.path.join(directory, title)
else:
options.output = title

View File

@ -70,7 +70,7 @@ class Kanal5(Service):
title = "%s-s%s-%s-%s-%s" % (data["program"]["name"], data["seasonNumber"], data["episodeText"], data["id"], options.service)
title = filenamify(title)
if len(directory):
options.output = "%s/%s" % (directory, title)
options.output = os.path.join(directory, title)
else:
options.output = title

View File

@ -32,7 +32,7 @@ class Mtvnn(Service, OpenGraphThumbMixin):
if options.output_auto:
directory = os.path.dirname(options.output)
if len(directory):
options.output = "%s/%s" % (directory, title)
options.output = os.path.join(directory, title)
else:
options.output = title

View File

@ -20,7 +20,7 @@ class Raw(Service):
extention = False
filename = os.path.basename(self.url[:self.url.rfind("/")-1])
if options.output and os.path.isdir(options.output):
options.output = "%s/%s" % (os.path.dirname(options.output), filename)
options.output = os.path.join(os.path.dirname(options.output), filename)
extention = True
elif options.output is None:
options.output = "%s" % filename

View File

@ -149,7 +149,7 @@ def outputfilename(data, filename, raw):
title = "%s.%s-%s-svtplay" % (name, other, data["videoId"])
title = filenamify(title)
if len(directory):
output = "%s/%s" % (directory, title)
output = os.path.join(directory, title)
else:
output = title
return output

View File

@ -92,7 +92,7 @@ class Tv4play(Service, OpenGraphThumbMixin):
title = "%s-%s-%s" % (options.output, vid, options.service)
title = filenamify(title)
if len(directory):
options.output = "%s/%s" % (directory, title)
options.output = os.path.join(directory, title)
else:
options.output = title

View File

@ -39,7 +39,7 @@ class Vg(Service, OpenGraphThumbMixin):
title = "%s" % jsondata["title"]
title = filenamify(title)
if len(directory):
options.output = "%s/%s" % (directory, title)
options.output = os.path.join(directory, title)
else:
options.output = title