From 3a4cfedd7b271debf9235e3ab7cfb05c717b6e27 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 6 Apr 2024 20:38:26 +0200 Subject: [PATCH] Ensure ffmpeg and yt-dlp are installed --- bot.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bot.php b/bot.php index bba4a28..6568018 100644 --- a/bot.php +++ b/bot.php @@ -57,6 +57,27 @@ if (class_exists(API::class)) { require_once 'madeline.php'; } +$process = Process::start([ + 'yt-dlp', + '--version' +]); +$out = buffer($process->getStdout()); +$err = buffer($process->getStderr()); +if ($process->join()) { + echo("yt-dlp is not installed, please install yt-dlp!".PHP_EOL); + die(1); +} +$process = Process::start([ + 'ffmpeg', + '-h' +]); +$out = buffer($process->getStdout()); +$err = buffer($process->getStderr()); +if ($process->join()) { + echo("ffmpeg is not installed, please install ffmpeg!"); + die(1); +} + /** * Event handler class. *