Skip to content

Commit

Permalink
api/youtube: add no matching format error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wukko committed Nov 13, 2024
1 parent 8b972c7 commit 5f1c19d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/processing/services/youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -443,5 +443,5 @@ export default async function(o) {
}
}

return { error: "fetch.fail" };
return { error: "youtube.no_matching_format" };
}

0 comments on commit 5f1c19d

Please sign in to comment.