mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
output: no need to get the filename when we already have it in options
This commit is contained in:
parent
60d2a01f16
commit
21cd9efe93
@ -90,7 +90,7 @@ class HDS(VideoRetriever):
|
||||
antal = readbox(bootstrap, box[0])
|
||||
baseurl = self.kwargs["manifest"][0:self.kwargs["manifest"].rfind("/")]
|
||||
|
||||
file_d = output(self.options, self.options.output, "flv")
|
||||
file_d = output(self.options, "flv")
|
||||
if hasattr(file_d, "read") is False:
|
||||
return
|
||||
|
||||
|
@ -88,7 +88,7 @@ class HLS(VideoRetriever):
|
||||
rand = os.urandom(16)
|
||||
decryptor = AES.new(key, AES.MODE_CBC, rand)
|
||||
|
||||
file_d = output(self.options, self.options.output, "ts")
|
||||
file_d = output(self.options, "ts")
|
||||
if hasattr(file_d, "read") is False:
|
||||
return
|
||||
|
||||
|
@ -28,7 +28,7 @@ class HTTP(VideoRetriever):
|
||||
total_size = int(total_size)
|
||||
bytes_so_far = 0
|
||||
|
||||
file_d = output(self.options, self.options.output, "mp4")
|
||||
file_d = output(self.options, "mp4")
|
||||
if hasattr(file_d, "read") is False:
|
||||
return
|
||||
|
||||
|
@ -22,7 +22,7 @@ class RTMP(VideoRetriever):
|
||||
if self.options.resume:
|
||||
args.append("-e")
|
||||
|
||||
file_d = output(self.options, self.options.output, "flv", False)
|
||||
file_d = output(self.options, "flv", False)
|
||||
if file_d is None:
|
||||
return
|
||||
args += ["-o", self.options.output]
|
||||
|
@ -113,14 +113,14 @@ def progressbar(total, pos, msg=""):
|
||||
|
||||
progress_stream.write(fmt % (pos, total, bar, msg))
|
||||
|
||||
def output(options, filename, extention="mp4", openfd=True):
|
||||
def output(options, extention="mp4", openfd=True):
|
||||
if is_py3:
|
||||
file_d = io.IOBase
|
||||
else:
|
||||
file_d = file
|
||||
|
||||
if options.output != "-":
|
||||
ext = re.search(r"(\.[a-z0-9]+)$", filename)
|
||||
ext = re.search(r"(\.[a-z0-9]+)$", options.output)
|
||||
if not ext:
|
||||
options.output = "%s.%s" % (options.output, extention)
|
||||
log.info("Outfile: %s", options.output)
|
||||
|
Loading…
Reference in New Issue
Block a user