Skip to content

best way to save what you love

vimeo: fix 1440p bug and format filtering

wukko4d850c5d64f1
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)
}