vimeo: fall back to width for quality label if unable to map

This commit is contained in:
dumbmoron 2024-03-04 23:25:46 +00:00
parent 04ce4c0645
commit 7420337ea2
No known key found for this signature in database
GPG key ID: C59997C76C6A8E5F

View file

@ -71,6 +71,7 @@ export default async function(obj) {
}
let masterM3U8 = `${masterJSONURL.split("/sep/")[0]}/sep/video/${bestVideo.id}/master.m3u8`;
const fallbackResolution = bestVideo.height > bestVideo.width ? bestVideo.width : bestVideo.height;
return {
urls: masterM3U8,
@ -81,8 +82,8 @@ export default async function(obj) {
id: obj.id,
title: fileMetadata.title,
author: fileMetadata.artist,
resolution: `${bestVideo["width"]}x${bestVideo["height"]}`,
qualityLabel: `${resolutionMatch[bestVideo["width"]]}p`,
resolution: `${bestVideo.width}x${bestVideo.height}`,
qualityLabel: `${resolutionMatch[bestVideo.width] || fallbackResolution}p`,
extension: "mp4"
}
}