mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 09:01:43 +00:00
[ffmpeg] Fix --ffmpeg-location
when directory is given
Bug introduced in 89efdc15dd
Closes #654
This commit is contained in:
parent
e9f4ccd19e
commit
8c0ae192a4
@ -109,7 +109,9 @@ def get_ffmpeg_version(path):
|
||||
'Continuing without ffmpeg.' % (location))
|
||||
self._versions = {}
|
||||
return
|
||||
elif not os.path.isdir(location):
|
||||
elif os.path.isdir(location):
|
||||
dirname, basename = location, None
|
||||
else:
|
||||
basename = os.path.splitext(os.path.basename(location))[0]
|
||||
basename = next((p for p in programs if basename.startswith(p)), 'ffmpeg')
|
||||
dirname = os.path.dirname(os.path.abspath(location))
|
||||
@ -118,7 +120,8 @@ def get_ffmpeg_version(path):
|
||||
|
||||
self._paths = dict(
|
||||
(p, os.path.join(dirname, p)) for p in programs)
|
||||
self._paths[basename] = location
|
||||
if basename:
|
||||
self._paths[basename] = location
|
||||
self._versions = dict(
|
||||
(p, get_ffmpeg_version(self._paths[p])) for p in programs)
|
||||
if self._versions is None:
|
||||
|
Loading…
Reference in New Issue
Block a user