From 4d850c5d64f13c4ea1059544445424c26bf6c5d7 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 17 Jan 2024 15:54:52 +0600 Subject: [PATCH] vimeo: fix 1440p bug and format filtering --- src/modules/processing/services/vimeo.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/processing/services/vimeo.js b/src/modules/processing/services/vimeo.js index 90dc9b3d..b2a031cd 100644 --- a/src/modules/processing/services/vimeo.js +++ b/src/modules/processing/services/vimeo.js @@ -4,6 +4,7 @@ import { cleanString } from '../../sub/utils.js'; const resolutionMatch = { "3840": "2160", "2732": "1440", + "2560": "1440", "2048": "1080", "1920": "1080", "1366": "720", @@ -63,8 +64,9 @@ export default async function(obj) { if (!masterJSON) return { error: 'ErrorCouldntFetch' }; if (!masterJSON.video) return { error: 'ErrorEmptyDownload' }; - let masterJSON_Video = masterJSON.video.sort((a, b) => Number(b.width) - Number(a.width)).filter(a => a['format'] === "mp42"), + let masterJSON_Video = masterJSON.video.sort((a, b) => Number(b.width) - Number(a.width)).filter(a => ["dash", "mp42"].includes(a['format'])), bestVideo = masterJSON_Video[0]; + console.log(masterJSON_Video) if (Number(quality) < Number(resolutionMatch[bestVideo["width"]])) { bestVideo = masterJSON_Video.find(i => resolutionMatch[i["width"]] === quality) }