1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-28 06:04:17 +01:00

output: dont overwrite end of the filename when its auto generated

fixes #469
This commit is contained in:
Johan Andersson 2016-12-06 22:08:41 +01:00
parent de055b885b
commit ab3907a0ff

View File

@ -154,7 +154,7 @@ def output(options, extention="mp4", openfd=True, mode="wb", **kwargs):
options.output = "%s.%s" % (options.output, extention) options.output = "%s.%s" % (options.output, extention)
if options.output_auto and ext: if options.output_auto and ext:
options.output = "%s.%s" % (options.output, extention) options.output = "%s.%s" % (options.output, extention)
if extention == "srt" and ext: elif extention == "srt" and ext:
options.output = "%s.srt" % options.output[:options.output.rfind(ext.group(1))] options.output = "%s.srt" % options.output[:options.output.rfind(ext.group(1))]
log.info("Outfile: %s", options.output) log.info("Outfile: %s", options.output)
if os.path.isfile(options.output) or \ if os.path.isfile(options.output) or \