From 30f97e3dfbea32e70b7bc5909dd8f1c2c3edb1a7 Mon Sep 17 00:00:00 2001 From: HappyTanuki Date: Thu, 13 Feb 2025 17:01:38 +0900 Subject: [PATCH] =?UTF-8?q?3=EC=B0=A8=20=20=EC=BD=94=EB=93=9C=20=EB=A6=AC?= =?UTF-8?q?=ED=8C=A9=ED=84=B0=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/Utils/VersionsCheckUtils.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/Utils/VersionsCheckUtils.hpp b/include/Utils/VersionsCheckUtils.hpp index 54d734f..567b765 100644 --- a/include/Utils/VersionsCheckUtils.hpp +++ b/include/Utils/VersionsCheckUtils.hpp @@ -15,8 +15,7 @@ public: return true; } - static void validateYTDLPFFMPEGBinary(std::shared_ptr cluster) { - cluster->log(dpp::ll_info, "Checking if yt-dlp and ffmpeg is available..."); + static void validateFFMPEG(std::shared_ptr cluster) { std::queue result = ConsoleUtils::getResultFromCommand(SettingsManager::getFFMPEG_CMD() + " -version"); std::string front = result.front(); if (front[0] != 'f' || @@ -40,8 +39,11 @@ public: system("mv ffmpeg-master-latest-linux64-gpl ffmpeg"); SettingsManager::setFFMPEG_CMD("./ffmpeg/bin/ffmpeg"); } - result = ConsoleUtils::getResultFromCommand(SettingsManager::getYTDLP_CMD() + " --version"); - front = result.front(); + } + + static void validateYTDLP(std::shared_ptr cluster) { + std::queue result = ConsoleUtils::getResultFromCommand(SettingsManager::getYTDLP_CMD() + " --version"); + std::string front = result.front(); if ((front[0]-'0' < 0 || front[0]-'0' > 9) || (front[1]-'0' < 0 || front[1]-'0' > 9) || (front[2]-'0' < 0 || front[2]-'0' > 9) || @@ -61,6 +63,12 @@ public: } } + static void validateYTDLPFFMPEGBinary(std::shared_ptr cluster) { + cluster->log(dpp::ll_info, "Checking if yt-dlp and ffmpeg is available..."); + validateFFMPEG(cluster); + validateYTDLP(cluster); + } + static void updateytdlp(std::shared_ptr cluster) { cluster->log(dpp::ll_info, "Checking if yt-dlp update is available..."); std::queue result = ConsoleUtils::getResultFromCommand("./yt-dlp -U");