api/youtube: use best quality if all else fails
This commit is contained in:
parent
98acea6c58
commit
da72b9615e
1 changed files with 3 additions and 1 deletions
|
@ -345,11 +345,13 @@ export default async function(o) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const bestQuality = qual(bestVideo);
|
const bestQuality = qual(bestVideo);
|
||||||
const useBestQuality = quality > bestQuality;
|
const useBestQuality = quality >= bestQuality;
|
||||||
|
|
||||||
video = useBestQuality ? bestVideo : adaptive_formats.find(i =>
|
video = useBestQuality ? bestVideo : adaptive_formats.find(i =>
|
||||||
qual(i) === quality && checkBestVideo(i)
|
qual(i) === quality && checkBestVideo(i)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!video) video = bestVideo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue