mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-17 22:00:00 +00:00
vimeo: fix 1440p bug and format filtering
This commit is contained in:
parent
18c0dbadfd
commit
4d850c5d64
1 changed files with 3 additions and 1 deletions
|
@ -4,6 +4,7 @@ import { cleanString } from '../../sub/utils.js';
|
||||||
const resolutionMatch = {
|
const resolutionMatch = {
|
||||||
"3840": "2160",
|
"3840": "2160",
|
||||||
"2732": "1440",
|
"2732": "1440",
|
||||||
|
"2560": "1440",
|
||||||
"2048": "1080",
|
"2048": "1080",
|
||||||
"1920": "1080",
|
"1920": "1080",
|
||||||
"1366": "720",
|
"1366": "720",
|
||||||
|
@ -63,8 +64,9 @@ export default async function(obj) {
|
||||||
if (!masterJSON) return { error: 'ErrorCouldntFetch' };
|
if (!masterJSON) return { error: 'ErrorCouldntFetch' };
|
||||||
if (!masterJSON.video) return { error: 'ErrorEmptyDownload' };
|
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];
|
bestVideo = masterJSON_Video[0];
|
||||||
|
console.log(masterJSON_Video)
|
||||||
if (Number(quality) < Number(resolutionMatch[bestVideo["width"]])) {
|
if (Number(quality) < Number(resolutionMatch[bestVideo["width"]])) {
|
||||||
bestVideo = masterJSON_Video.find(i => resolutionMatch[i["width"]] === quality)
|
bestVideo = masterJSON_Video.find(i => resolutionMatch[i["width"]] === quality)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue