aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/PostProcessor.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-12-16 12:29:03 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-12-16 12:29:03 +0100
commit5910e210f48826c6d078ef3744b25d209535c3ae (patch)
treed6745ed1f4d45f3c5fe3b6211bc2801f6518a2fd /youtube_dl/PostProcessor.py
parentb375c8b9469a94a4c8f0c8acc1558d2d6005f01b (diff)
Fix --extract-audio on Python 3
Diffstat (limited to 'youtube_dl/PostProcessor.py')
-rw-r--r--youtube_dl/PostProcessor.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/PostProcessor.py b/youtube_dl/PostProcessor.py
index af00f80ee..cc7789e3b 100644
--- a/youtube_dl/PostProcessor.py
+++ b/youtube_dl/PostProcessor.py
@@ -86,14 +86,14 @@ class FFmpegExtractAudioPP(PostProcessor):
if not self._exes['ffprobe'] and not self._exes['avprobe']: return None
try:
cmd = [self._exes['avprobe'] or self._exes['ffprobe'], '-show_streams', '--', encodeFilename(path)]
- handle = subprocess.Popen(cmd, stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)
+ handle = subprocess.Popen(cmd, stderr=compat_subprocess_get_DEVNULL(), stdout=subprocess.PIPE)
output = handle.communicate()[0]
if handle.wait() != 0:
return None
except (IOError, OSError):
return None
audio_codec = None
- for line in output.split('\n'):
+ for line in output.decode('ascii', 'ignore').split('\n'):
if line.startswith('codec_name='):
audio_codec = line.split('=')[1].strip()
elif line.strip() == 'codec_type=audio' and audio_codec is not None: