diff --git a/src/modules/processing/match.js b/src/modules/processing/match.js index f1641baa..16f48afc 100644 --- a/src/modules/processing/match.js +++ b/src/modules/processing/match.js @@ -104,6 +104,7 @@ export default async function(host, patternMatch, url, lang, obj) { case "vimeo": r = await vimeo({ id: patternMatch.id.slice(0, 11), + password: patternMatch.password, quality: obj.vQuality, isAudioOnly: isAudioOnly, forceDash: isAudioOnly ? true : obj.vimeoDash diff --git a/src/modules/processing/services/vimeo.js b/src/modules/processing/services/vimeo.js index 7c6aab94..f51f7220 100644 --- a/src/modules/processing/services/vimeo.js +++ b/src/modules/processing/services/vimeo.js @@ -28,7 +28,14 @@ export default async function(obj) { let quality = obj.quality === "max" ? "9000" : obj.quality; if (!quality || obj.isAudioOnly) quality = "9000"; - let api = await fetch(`https://player.vimeo.com/video/${obj.id}/config`).then((r) => { return r.json() }).catch(() => { return false }); + const url = new URL(`https://player.vimeo.com/video/${obj.id}/config`); + if (obj.password) { + url.searchParams.set('h', obj.password); + } + + let api = await fetch(url) + .then(r => r.json()) + .catch(() => {}); if (!api) return { error: 'ErrorCouldntFetch' }; let downloadType = "dash"; diff --git a/src/modules/processing/servicesConfig.json b/src/modules/processing/servicesConfig.json index 40bc1530..b92f5751 100644 --- a/src/modules/processing/servicesConfig.json +++ b/src/modules/processing/servicesConfig.json @@ -64,7 +64,7 @@ "enabled": false }, "vimeo": { - "patterns": [":id", "video/:id"], + "patterns": [":id", "video/:id", ":id/:password"], "enabled": true, "bestAudio": "mp3" }, diff --git a/src/modules/processing/servicesPatternTesters.js b/src/modules/processing/servicesPatternTesters.js index 393a9c99..f4dee15b 100644 --- a/src/modules/processing/servicesPatternTesters.js +++ b/src/modules/processing/servicesPatternTesters.js @@ -42,7 +42,8 @@ export const testers = { patternMatch.id?.length < 20, "vimeo": (patternMatch) => - patternMatch.id?.length <= 11, + patternMatch.id?.length <= 11 + && (!patternMatch.password || patternMatch.password.length < 16), "vine": (patternMatch) => patternMatch.id?.length <= 12, diff --git a/src/test/tests.json b/src/test/tests.json index 94fc43a4..e404859f 100644 --- a/src/test/tests.json +++ b/src/test/tests.json @@ -847,6 +847,14 @@ "code": 200, "status": "stream" } + }, { + "name": "private video", + "url": "https://vimeo.com/903115595/f14d06da38", + "params": {}, + "expected": { + "code": 200, + "status": "stream" + } }], "reddit": [{ "name": "video with audio",