mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-29 04:50:13 +02:00
api/youtube: add no matching format error
this error is returned when cobalt got a response from innertube, but couldn't find a matching combo of video and audio streams. sometimes youtube returns only video or only audio per format combo for whatever reason.
This commit is contained in:
parent
8b972c7a85
commit
5f1c19d0f1
@ -264,7 +264,7 @@ export default async function(o) {
|
||||
}
|
||||
|
||||
if (!selected) {
|
||||
return { error: "youtube.no_hls_streams" };
|
||||
return { error: "youtube.no_matching_format" };
|
||||
}
|
||||
|
||||
audio = selected.audio.find(i => i.isDefault);
|
||||
@ -320,7 +320,7 @@ export default async function(o) {
|
||||
const bestAudio = !fallback ? earlyBestAudio : adaptive_formats.find(i => checkBestAudio(i));
|
||||
|
||||
if (checkNoMedia(bestVideo, bestAudio)) {
|
||||
return { error: "youtube.codec" };
|
||||
return { error: "youtube.no_matching_format" };
|
||||
}
|
||||
|
||||
audio = bestAudio;
|
||||
@ -443,5 +443,5 @@ export default async function(o) {
|
||||
}
|
||||
}
|
||||
|
||||
return { error: "fetch.fail" };
|
||||
return { error: "youtube.no_matching_format" };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user