From d470c8c29aa9910ac733411ab606b4f44f125fef Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 23 Jan 2016 13:10:42 +0800 Subject: [PATCH] [ffmpeg] more check_call replacing wrong 'raise's --- src/you_get/processor/ffmpeg.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/you_get/processor/ffmpeg.py b/src/you_get/processor/ffmpeg.py index 6b61ae18..7262c462 100644 --- a/src/you_get/processor/ffmpeg.py +++ b/src/you_get/processor/ffmpeg.py @@ -170,11 +170,9 @@ def ffmpeg_concat_mp4_to_mp4(files, output='output.mp4'): params.append(output + '.txt') params += ['-c', 'copy', output] - if subprocess.call(params) == 0: - os.remove(output + '.txt') - return True - else: - raise + subprocess.check_call(params) + os.remove(output + '.txt') + return True for file in files: if os.path.isfile(file): @@ -196,9 +194,7 @@ def ffmpeg_concat_mp4_to_mp4(files, output='output.mp4'): else: params += ['-c', 'copy', '-absf', 'aac_adtstoasc', output] - if subprocess.call(params) == 0: - for file in files: - os.remove(file + '.ts') - return True - else: - raise + subprocess.check_call(params) + for file in files: + os.remove(file + '.ts') + return True