mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-26 23:00:22 +00:00
parent
b7b4796bf2
commit
65f934dc93
@ -71,13 +71,14 @@ class FFmpegExtractAudioPP(PostProcessor):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def detect_executables():
|
def detect_executables():
|
||||||
available = {'avprobe' : False, 'avconv' : False, 'ffmpeg' : False, 'ffprobe' : False}
|
def executable(exe):
|
||||||
for path in os.environ["PATH"].split(os.pathsep):
|
try:
|
||||||
for program in available.keys():
|
subprocess.check_output([exe, '-version'])
|
||||||
exe_file = os.path.join(path, program)
|
except OSError:
|
||||||
if os.path.isfile(exe_file) and os.access(exe_file, os.X_OK):
|
return False
|
||||||
available[program] = exe_file
|
return exe
|
||||||
return available
|
programs = ['avprobe', 'avconv', 'ffmpeg', 'ffprobe']
|
||||||
|
return dict((program, executable(program)) for program in programs)
|
||||||
|
|
||||||
def get_audio_codec(self, path):
|
def get_audio_codec(self, path):
|
||||||
if not self._exes['ffprobe'] and not self._exes['avprobe']: return None
|
if not self._exes['ffprobe'] and not self._exes['avprobe']: return None
|
||||||
|
Loading…
Reference in New Issue
Block a user