FFmpegPostProcessor: decode stderr first and then get the last line (closes #837)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 12 May 2013 17:08:32 +0000 (19:08 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 12 May 2013 17:08:32 +0000 (19:08 +0200)
youtube_dl/PostProcessor.py

index 0c6885dda6a5b1ed36bfceba49288231f3a53028..8868b37af6455523bad0fbf9a6702fd37e45d024 100644 (file)
@@ -85,8 +85,9 @@ class FFmpegPostProcessor(PostProcessor):
         p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         stdout,stderr = p.communicate()
         if p.returncode != 0:
+            stderr = stderr.decode('utf-8', 'replace')
             msg = stderr.strip().split('\n')[-1]
-            raise FFmpegPostProcessorError(msg.decode('utf-8', 'replace'))
+            raise FFmpegPostProcessorError(msg)
 
     def _ffmpeg_filename_argument(self, fn):
         # ffmpeg broke --, see https://ffmpeg.org/trac/ffmpeg/ticket/2127 for details