mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
api/youtube: use best quality if all else fails
This commit is contained in:
parent
98acea6c58
commit
da72b9615e
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue