diff --git a/api/src/processing/services/youtube.js b/api/src/processing/services/youtube.js index e3265b33..affdf40f 100644 --- a/api/src/processing/services/youtube.js +++ b/api/src/processing/services/youtube.js @@ -345,11 +345,13 @@ export default async function(o) { } const bestQuality = qual(bestVideo); - const useBestQuality = quality > bestQuality; + const useBestQuality = quality >= bestQuality; video = useBestQuality ? bestVideo : adaptive_formats.find(i => qual(i) === quality && checkBestVideo(i) ); + + if (!video) video = bestVideo; } }