From 0bd0f8f156b82101be8a55f7caae06a506e64ae6 Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 22 Jul 2024 11:25:18 +0200 Subject: [PATCH] feat(download): add remux option for best audio quality Introduced a 'remux' option in the download functionality, enabling users to remux videos with the best available audio when selected. This enhances the audio quality of downloaded videos when the option is checked in the UI. Added corresponding checkbox in the template for user selection. --- classes/Controller/DownloadController.php | 8 +++++++- templates/info.tpl | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/Controller/DownloadController.php b/classes/Controller/DownloadController.php index dece054..daf0f15 100644 --- a/classes/Controller/DownloadController.php +++ b/classes/Controller/DownloadController.php @@ -44,7 +44,13 @@ class DownloadController extends BaseController { $url = $this->getVideoPageUrl($request); - $this->video = $this->downloader->getVideo($url, $this->getFormat($request), $this->getPassword($request)); + $format = $this->getFormat($request); + + if ($this->config->remux && $request->getQueryParam('remux')) { + $this->video = $this->downloader->getVideo($url, $format . "+bestaudio", $this->getPassword($request)); + } else { + $this->video = $this->downloader->getVideo($url, $format, $this->getPassword($request)); + } try { if ($this->config->convert && $request->getQueryParam('audio')) { diff --git a/templates/info.tpl b/templates/info.tpl index d315588..18febfc 100644 --- a/templates/info.tpl +++ b/templates/info.tpl @@ -32,6 +32,10 @@ {html_options name='format' options=$formats selected=$defaultFormat id="format" class="formats monospace"}

+ + +
+
{/if} {if $config->stream} stream !== 'ask'}checked{/if} name="stream" id="stream"/>