mirror of
https://github.com/imputnet/cobalt.git
synced 2026-10-31 23:04:47 +00:00
api: add an option to allow better audio from youtube
& an env variable to disable it if needed
This commit is contained in:
parent
0294bbd447
commit
335cd51eb5
3 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -46,5 +46,6 @@ export const apiSchema = z.object({
|
|||
localProcessing: z.boolean().default(false),
|
||||
|
||||
youtubeHLS: z.boolean().default(false),
|
||||
youtubeBetterAudio: z.boolean().default(false),
|
||||
})
|
||||
.strict();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue