Update os.py

fix command where/which for windows/linux
This commit is contained in:
Hat3 2024-12-06 18:58:12 +01:00 committed by GitHub
parent eda320b314
commit 67735993fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -444,11 +444,19 @@ class OsSummary():
# ffmpeg and ffprobe versions # ffmpeg and ffprobe versions
ffmpeg_path, ffprobe_path = check_ffmpeg() ffmpeg_path, ffprobe_path = check_ffmpeg()
if platform.system() == "Windows":
# Usa il comando 'where' su Windows
command = 'where'
else:
# Usa il comando 'which' su Unix/Linux
command = 'which'
# Locate ffmpeg and ffprobe # Locate ffmpeg and ffprobe
if "binary" not in ffmpeg_path: if "binary" not in ffmpeg_path:
ffmpeg_path = self.check_ffmpeg_location(['where', 'ffmpeg']) ffmpeg_path = self.check_ffmpeg_location([command, 'ffmpeg'])
if "binary" not in ffprobe_path: if "binary" not in ffprobe_path:
ffprobe_path = self.check_ffmpeg_location(['where', 'ffprobe']) ffprobe_path = self.check_ffmpeg_location([command, 'ffprobe'])
ffmpeg_version = self.get_executable_version([ffprobe_path, '-version']) ffmpeg_version = self.get_executable_version([ffprobe_path, '-version'])
ffprobe_version = self.get_executable_version([ffprobe_path, '-version']) ffprobe_version = self.get_executable_version([ffprobe_path, '-version'])