From 772faa5901ef2872bfc39f02ccb7da27c6cdaaa9 Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Thu, 3 Sep 2020 09:11:23 +0200 Subject: [PATCH] Log ffmpeg command and handle errors better --- twitchdl/commands.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/twitchdl/commands.py b/twitchdl/commands.py index b720d26..0cc0d5b 100644 --- a/twitchdl/commands.py +++ b/twitchdl/commands.py @@ -104,13 +104,13 @@ def _select_playlist_interactive(playlists): def _join_vods(directory, file_paths, target): - input_path = "{}/files.txt".format(directory) + input_path = "{}files.txt".format(directory) with open(input_path, 'w') as f: for path in file_paths: f.write('file {}\n'.format(os.path.basename(path))) - result = subprocess.run([ + command = [ "ffmpeg", "-f", "concat", "-i", input_path, @@ -118,9 +118,12 @@ def _join_vods(directory, file_paths, target): target, "-stats", "-loglevel", "warning", - ]) + ] - result.check_returncode() + print_out("{}".format(" ".join(command))) + result = subprocess.run(command) + if result.returncode != 0: + raise ConsoleError("Joining files failed") def _video_target_filename(video, format):