From ac7dac9f81ca2d299998fb32fedb0ec73c5f73ec Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 27 Jul 2025 11:41:55 +0500 Subject: feat: select yt-dlp quality --- public/upload.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'public/upload.php') diff --git a/public/upload.php b/public/upload.php index 15a66d2..123c30a 100644 --- a/public/upload.php +++ b/public/upload.php @@ -49,7 +49,8 @@ try { if (FILEEXT_ENABLED && isset($url) && !empty($url)) { $output = []; - exec('yt-dlp -f "worst" --get-filename -o "%(filesize_approx)s %(ext)s %(duration)s" ' . escapeshellarg($url) . '', $output); + $fileext_quality = FILEEXT_QUALITY ? ('-f "' . FILEEXT_QUALITY . '"') : ""; + exec('yt-dlp ' . $fileext_quality . ' --get-filename -o "%(filesize_approx)s %(ext)s %(duration)s" ' . escapeshellarg($url) . '', $output); if (empty($output)) { throw new RuntimeException('Bad URL'); } @@ -166,7 +167,8 @@ try { $file_path = FILE_UPLOAD_DIRECTORY . "/$file_id.{$file_data['extension']}"; exec(sprintf( - 'yt-dlp -f "worst" -o "%s" %s 2>&1', + 'yt-dlp %s -o "%s" %s 2>&1', + FILEEXT_QUALITY ? ('-f "' . FILEEXT_QUALITY . '"') : "", $file_path, escapeshellarg($url) ), $output, $result); -- cgit v1.2.3