diff --git a/lib/svtplay_dl/output.py b/lib/svtplay_dl/output.py index 4eb3ba9..b8e7821 100644 --- a/lib/svtplay_dl/output.py +++ b/lib/svtplay_dl/output.py @@ -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): diff --git a/lib/svtplay_dl/service/disney.py b/lib/svtplay_dl/service/disney.py index bc7ae72..483ff4a 100644 --- a/lib/svtplay_dl/service/disney.py +++ b/lib/svtplay_dl/service/disney.py @@ -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 diff --git a/lib/svtplay_dl/service/kanal5.py b/lib/svtplay_dl/service/kanal5.py index c055f70..a8a9894 100644 --- a/lib/svtplay_dl/service/kanal5.py +++ b/lib/svtplay_dl/service/kanal5.py @@ -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 diff --git a/lib/svtplay_dl/service/mtvnn.py b/lib/svtplay_dl/service/mtvnn.py index 4df0ebb..b7748d2 100644 --- a/lib/svtplay_dl/service/mtvnn.py +++ b/lib/svtplay_dl/service/mtvnn.py @@ -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 diff --git a/lib/svtplay_dl/service/raw.py b/lib/svtplay_dl/service/raw.py index 36928b0..7dfb40f 100644 --- a/lib/svtplay_dl/service/raw.py +++ b/lib/svtplay_dl/service/raw.py @@ -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 diff --git a/lib/svtplay_dl/service/svtplay.py b/lib/svtplay_dl/service/svtplay.py index 11c61e5..9205c6c 100644 --- a/lib/svtplay_dl/service/svtplay.py +++ b/lib/svtplay_dl/service/svtplay.py @@ -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 diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index 3e2d361..4a3bb38 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -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 diff --git a/lib/svtplay_dl/service/vg.py b/lib/svtplay_dl/service/vg.py index 531392c..83f903d 100644 --- a/lib/svtplay_dl/service/vg.py +++ b/lib/svtplay_dl/service/vg.py @@ -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