From ea1b28890ec72a7b990775621cfc11181e96be14 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 13 Jul 2023 11:39:07 +0200 Subject: [PATCH] fix mkdir --- src/home/telecaster/bin/py/transcode-vaapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/home/telecaster/bin/py/transcode-vaapi.py b/src/home/telecaster/bin/py/transcode-vaapi.py index 4aadeb7..8a03205 100644 --- a/src/home/telecaster/bin/py/transcode-vaapi.py +++ b/src/home/telecaster/bin/py/transcode-vaapi.py @@ -56,12 +56,12 @@ class Transcode(object): for output_format in self.output_formats: output_format = self.output_formats[output_format] output_dir = root.replace(self.input_dir, self.output_dir) + if not os.path.exists(output_dir): + os.makedirs(output_dir) output_file = name + '.' + output_format["ext"] output_path = os.path.abspath(output_dir + os.sep + output_file) local_files = os.listdir(output_dir) print(output_path) - if not os.path.exists(output_dir): - os.makedirs(output_dir) if not (output_file in local_files or self.get_ext_in_dir(output_format["ext"], root)) or '--force' in self.args: command = 'ffmpeg ' + output_format['opt_in'] + ' -i "' + input_path + '" ' + \ output_format['opt_out'] + ' -y "' + output_path + '"' -- 2.39.5