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.
This commit is contained in:
Kumi 2024-07-22 11:25:18 +02:00
parent a563c57d7f
commit 0bd0f8f156
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 11 additions and 1 deletions

View file

@ -44,7 +44,13 @@ class DownloadController extends BaseController
{ {
$url = $this->getVideoPageUrl($request); $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 { try {
if ($this->config->convert && $request->getQueryParam('audio')) { if ($this->config->convert && $request->getQueryParam('audio')) {

View file

@ -32,6 +32,10 @@
{html_options name='format' options=$formats selected=$defaultFormat id="format" class="formats monospace"} {html_options name='format' options=$formats selected=$defaultFormat id="format" class="formats monospace"}
<br/> <br/>
<br/> <br/>
<input type="checkbox" checked name="remux" id="remux" value="1"/>
<label for="remux">{t}Remux with best audio{/t}</label>
<br/>
<br/>
{/if} {/if}
{if $config->stream} {if $config->stream}
<input type="checkbox" {if $config->stream !== 'ask'}checked{/if} name="stream" id="stream"/> <input type="checkbox" {if $config->stream !== 'ask'}checked{/if} name="stream" id="stream"/>