From 808b786f5edb7c7689b7b011436c1168ee135cc6 Mon Sep 17 00:00:00 2001 From: Clement Desmidt Date: Tue, 6 Aug 2024 17:05:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Trying=20to=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/Commands/Youtubedl.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bot/Commands/Youtubedl.php b/bot/Commands/Youtubedl.php index e170924..1b91110 100644 --- a/bot/Commands/Youtubedl.php +++ b/bot/Commands/Youtubedl.php @@ -16,7 +16,7 @@ class Youtubedl implements Icommands $bot->replyPolitely('L\'url n\'est pas conforme'); } - if (!in_array($type, ['', 'audio', 'video'], true)) { + if (!in_array($type, ['', 'audio', 'video', 'vidéo'], true)) { $bot->replyPolitely('Je n\'ai pas compris ce que je devais faire'); } @@ -24,10 +24,14 @@ class Youtubedl implements Icommands if (in_array($type, ['', 'audio'], true)) { $type = 'l\'audio'; - exec(sprintf('%s --extract-audio --audio-format mp3 -o %s%s %s &> /dev/null &', $youtubedl, static::getDownloadFolder($bot), '%(upload_date)s-%(uploader)s-%(title)s.%(ext)s', $url)); + $cmd = sprintf('%s --extract-audio --audio-format mp3 -o %s%s %s', $youtubedl, static::getDownloadFolder($bot), '%(upload_date)s-%(uploader)s-%(title)s.%(ext)s', $url); + exec($cmd, $output); + $bot->sendChatMessage('', sprintf('Je lance %s', $cmd)); } else { $type = 'la vidéo'; - exec(sprintf('%s -f bestvideo+bestaudio/best -o %s%s %s &> /dev/null &', $youtubedl, static::getDownloadFolder($bot), '%(upload_date)s-%(uploader)s-%(title)s.%(ext)s', $url)); + $cmd = sprintf('%s -f bestvideo+bestaudio/best -o %s%s %s', $youtubedl, static::getDownloadFolder($bot), '%(upload_date)s-%(uploader)s-%(title)s.%(ext)s', $url); + exec($cmd, $output); + $bot->sendChatMessage('', sprintf('Je lance %s', $cmd)); } $bot->replyPolitely(sprintf('Je %s %s', $action, $type)); }