use list of arguments for ffprobe instead of running string with shell=True

This commit is contained in:
iLLiCiTiT 2021-11-19 18:25:58 +01:00
parent 9f8f94ccd9
commit 8e07e0e32b

View file

@ -71,18 +71,24 @@ def ffprobe_streams(path_to_file, logger=None):
"Getting information about input \"{}\".".format(path_to_file)
)
args = [
"\"{}\"".format(get_ffmpeg_tool_path("ffprobe")),
"-v quiet",
"-print_format json",
get_ffmpeg_tool_path("ffprobe"),
"-hide_banner",
"-loglevel", "fatal",
"-show_error",
"-show_format",
"-show_streams",
"\"{}\"".format(path_to_file)
"-show_programs",
"-show_chapters",
"-show_private_data",
"-print_format", "json",
path_to_file
]
command = " ".join(args)
logger.debug("FFprobe command: \"{}\"".format(command))
logger.debug("FFprobe command: {}".format(
subprocess.list2cmdline(args)
))
popen = subprocess.Popen(
command,
shell=True,
args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)