vimeo: add support for private videos
This commit is contained in:
parent
7420337ea2
commit
52e6a40641
5 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
"enabled": false
|
||||
},
|
||||
"vimeo": {
|
||||
"patterns": [":id", "video/:id"],
|
||||
"patterns": [":id", "video/:id", ":id/:password"],
|
||||
"enabled": true,
|
||||
"bestAudio": "mp3"
|
||||
},
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue