mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-20 16:37:06 +00:00
Split a couple of lines to make the code more readable
This commit is contained in:
parent
e3f7e05c27
commit
2727dbf78d
@ -2620,8 +2620,8 @@ class FFmpegExtractAudioPP(PostProcessor):
|
||||
@staticmethod
|
||||
def get_audio_codec(path):
|
||||
try:
|
||||
handle = subprocess.Popen(['ffprobe', '-show_streams', '--', path],
|
||||
stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)
|
||||
cmd = ['ffprobe', '-show_streams', '--', path]
|
||||
handle = subprocess.Popen(cmd, stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)
|
||||
output = handle.communicate()[0]
|
||||
if handle.wait() != 0:
|
||||
return None
|
||||
@ -2638,8 +2638,8 @@ class FFmpegExtractAudioPP(PostProcessor):
|
||||
@staticmethod
|
||||
def run_ffmpeg(path, out_path, codec, more_opts):
|
||||
try:
|
||||
ret = subprocess.call(['ffmpeg', '-y', '-i', path, '-vn', '-acodec', codec] + more_opts + ['--', out_path],
|
||||
stdout=file(os.path.devnull, 'w'), stderr=subprocess.STDOUT)
|
||||
cmd = ['ffmpeg', '-y', '-i', path, '-vn', '-acodec', codec] + more_opts + ['--', out_path]
|
||||
ret = subprocess.call(cmd, stdout=file(os.path.devnull, 'w'), stderr=subprocess.STDOUT)
|
||||
return (ret == 0)
|
||||
except (IOError, OSError):
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user