]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[postprocessor/ffmpeg] Fix crash when ffprobe/avprobe are not installed (closes ...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 3 Apr 2015 12:09:50 +0000 (14:09 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 3 Apr 2015 12:09:50 +0000 (14:09 +0200)
'self.probe_basename' was None, so 'probe_executable' raised a KeyError exception

youtube_dl/postprocessor/ffmpeg.py

index 55adf9685b3e1407d6cb1fe1e1205e290203fa95..0b60ac7e750bc2b308e4c7a8c01c8b988b036450 100644 (file)
@@ -116,6 +116,10 @@ class FFmpegPostProcessor(PostProcessor):
     def executable(self):
         return self._paths[self.basename]
 
+    @property
+    def probe_available(self):
+        return self.probe_basename is not None
+
     @property
     def probe_executable(self):
         return self._paths[self.probe_basename]
@@ -168,7 +172,7 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
 
     def get_audio_codec(self, path):
 
-        if not self.probe_executable:
+        if not self.probe_available:
             raise PostProcessingError('ffprobe or avprobe not found. Please install one.')
         try:
             cmd = [