summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-07-27 11:41:55 +0500
committerilotterytea <iltsu@alright.party>2025-07-27 11:41:55 +0500
commitac7dac9f81ca2d299998fb32fedb0ec73c5f73ec (patch)
treee1e8cde00a4003bc6dfce6a61b6c13857e8e7870 /public
parent8168cc771b81b14b13a2e042cef3d07589bf0655 (diff)
feat: select yt-dlp quality
Diffstat (limited to 'public')
-rw-r--r--public/upload.php6
1 files changed, 4 insertions, 2 deletions
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);