From 67735993fa05eaab0598e9c016f7713ee8038547 Mon Sep 17 00:00:00 2001 From: Hat3 Date: Fri, 6 Dec 2024 18:58:12 +0100 Subject: [PATCH] Update os.py fix command where/which for windows/linux --- StreamingCommunity/Util/os.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/StreamingCommunity/Util/os.py b/StreamingCommunity/Util/os.py index 9efb399..311e6f3 100644 --- a/StreamingCommunity/Util/os.py +++ b/StreamingCommunity/Util/os.py @@ -444,11 +444,19 @@ class OsSummary(): # ffmpeg and ffprobe versions 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 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: - 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']) ffprobe_version = self.get_executable_version([ffprobe_path, '-version'])