api: add an option to allow better audio from youtube

& an env variable to disable it if needed
This commit is contained in:
wukko
2025-04-20 20:45:07 +06:00
parent 0294bbd447
commit 335cd51eb5
3 changed files with 6 additions and 0 deletions

View File

@@ -113,6 +113,10 @@ export default async function({ host, patternMatch, params }) {
fetchInfo.format = "vp9";
fetchInfo.isAudioOnly = true;
fetchInfo.isAudioMuted = false;
if (env.ytAllowBetterAudio && params.youtubeBetterAudio) {
fetchInfo.quality = "max";
}
}
r = await youtube(fetchInfo);