From 5f1c19d0f13b8d9ceb16b637b002aae99bc54456 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 13 Nov 2024 15:00:09 +0600 Subject: [PATCH] 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. --- api/src/processing/services/youtube.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js index 2c21c4a4..bd741fca 100644 --- a/api/src/processing/services/youtube.js +++ b/api/src/processing/services/youtube.js @@ -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" }; }