mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Quality process updated
This commit is contained in:
@@ -54,9 +54,9 @@ export async function stream(url: string, options: StreamOptions = {}): Promise<
|
||||
}
|
||||
|
||||
const audioFormat = parseAudioFormats(info.format);
|
||||
if (!options.quality) options.quality = audioFormat.length - 1;
|
||||
if (typeof options.quality !== 'number') options.quality = audioFormat.length - 1;
|
||||
else if (options.quality <= 0) options.quality = 0;
|
||||
else if (options.quality > audioFormat.length) options.quality = audioFormat.length - 1;
|
||||
else if (options.quality >= audioFormat.length) options.quality = audioFormat.length - 1;
|
||||
final.push(audioFormat[options.quality]);
|
||||
let type: StreamType =
|
||||
audioFormat[options.quality].codec === 'opus' && audioFormat[options.quality].container === 'webm'
|
||||
@@ -87,9 +87,9 @@ export async function stream_from_info(info: InfoData, options: StreamOptions =
|
||||
}
|
||||
|
||||
const audioFormat = parseAudioFormats(info.format);
|
||||
if (!options.quality) options.quality = audioFormat.length - 1;
|
||||
if (typeof options.quality !== 'number') options.quality = audioFormat.length - 1;
|
||||
else if (options.quality <= 0) options.quality = 0;
|
||||
else if (options.quality > audioFormat.length) options.quality = audioFormat.length - 1;
|
||||
else if (options.quality >= audioFormat.length) options.quality = audioFormat.length - 1;
|
||||
final.push(audioFormat[options.quality]);
|
||||
let type: StreamType =
|
||||
audioFormat[options.quality].codec === 'opus' && audioFormat[options.quality].container === 'webm'
|
||||
|
||||
Reference in New Issue
Block a user