mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 01:45:15 +00:00
3차 코드 리팩터터
This commit is contained in:
@@ -15,8 +15,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void validateYTDLPFFMPEGBinary(std::shared_ptr<dpp::cluster> cluster) {
|
static void validateFFMPEG(std::shared_ptr<dpp::cluster> cluster) {
|
||||||
cluster->log(dpp::ll_info, "Checking if yt-dlp and ffmpeg is available...");
|
|
||||||
std::queue<std::string> result = ConsoleUtils::getResultFromCommand(SettingsManager::getFFMPEG_CMD() + " -version");
|
std::queue<std::string> result = ConsoleUtils::getResultFromCommand(SettingsManager::getFFMPEG_CMD() + " -version");
|
||||||
std::string front = result.front();
|
std::string front = result.front();
|
||||||
if (front[0] != 'f' ||
|
if (front[0] != 'f' ||
|
||||||
@@ -40,8 +39,11 @@ public:
|
|||||||
system("mv ffmpeg-master-latest-linux64-gpl ffmpeg");
|
system("mv ffmpeg-master-latest-linux64-gpl ffmpeg");
|
||||||
SettingsManager::setFFMPEG_CMD("./ffmpeg/bin/ffmpeg");
|
SettingsManager::setFFMPEG_CMD("./ffmpeg/bin/ffmpeg");
|
||||||
}
|
}
|
||||||
result = ConsoleUtils::getResultFromCommand(SettingsManager::getYTDLP_CMD() + " --version");
|
}
|
||||||
front = result.front();
|
|
||||||
|
static void validateYTDLP(std::shared_ptr<dpp::cluster> cluster) {
|
||||||
|
std::queue<std::string> result = ConsoleUtils::getResultFromCommand(SettingsManager::getYTDLP_CMD() + " --version");
|
||||||
|
std::string front = result.front();
|
||||||
if ((front[0]-'0' < 0 || front[0]-'0' > 9) ||
|
if ((front[0]-'0' < 0 || front[0]-'0' > 9) ||
|
||||||
(front[1]-'0' < 0 || front[1]-'0' > 9) ||
|
(front[1]-'0' < 0 || front[1]-'0' > 9) ||
|
||||||
(front[2]-'0' < 0 || front[2]-'0' > 9) ||
|
(front[2]-'0' < 0 || front[2]-'0' > 9) ||
|
||||||
@@ -61,6 +63,12 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void validateYTDLPFFMPEGBinary(std::shared_ptr<dpp::cluster> cluster) {
|
||||||
|
cluster->log(dpp::ll_info, "Checking if yt-dlp and ffmpeg is available...");
|
||||||
|
validateFFMPEG(cluster);
|
||||||
|
validateYTDLP(cluster);
|
||||||
|
}
|
||||||
|
|
||||||
static void updateytdlp(std::shared_ptr<dpp::cluster> cluster) {
|
static void updateytdlp(std::shared_ptr<dpp::cluster> cluster) {
|
||||||
cluster->log(dpp::ll_info, "Checking if yt-dlp update is available...");
|
cluster->log(dpp::ll_info, "Checking if yt-dlp update is available...");
|
||||||
std::queue<std::string> result = ConsoleUtils::getResultFromCommand("./yt-dlp -U");
|
std::queue<std::string> result = ConsoleUtils::getResultFromCommand("./yt-dlp -U");
|
||||||
|
|||||||
Reference in New Issue
Block a user