A feature-rich command-line audio/video downloader
Catch possible exceptions when running ffprobe
Ricardo Garciada273188f33a
diff --git a/youtube-dl b/youtube-dlindex 9e9be67784..617ac1339b 100755--- a/youtube-dl+++ b/youtube-dl@@ -2619,10 +2619,13 @@ class FFmpegExtractAudioPP(PostProcessor):@staticmethoddef get_audio_codec(path):- handle = subprocess.Popen(['ffprobe', '-show_streams', path],- stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)- output = handle.communicate()[0]- if handle.wait() != 0:+ try:+ handle = subprocess.Popen(['ffprobe', '-show_streams', path],+ stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)+ output = handle.communicate()[0]+ if handle.wait() != 0:+ return None+ except (IOError, OSError):return Noneaudio_codec = Nonefor line in output.split('\n'):@@ -2646,7 +2649,7 @@ class FFmpegExtractAudioPP(PostProcessor):filecodec = self.get_audio_codec(path)if filecodec is None:- self._downloader.to_stderr(u'WARNING: no audio codec found in file')+ self._downloader.to_stderr(u'WARNING: unable to obtain file audio codec with ffprobe')return Nonemore_opts = []