mirror of
https://github.com/danog/downloadRenameBot.git
synced 2024-11-26 12:04:54 +01:00
Ensure ffmpeg and yt-dlp are installed
This commit is contained in:
parent
b89147689f
commit
3a4cfedd7b
21
bot.php
21
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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user