Skip to content

Commit 831234a

Browse files
committed
api/vimeo: add support for specifying access tokens
* the android client now also needs a valid device_identifier, but already generated access_tokens work fine * you can also get them from a rooted device by mitm'ing the device while starting vimeo for the first time or going into its data directory and searching for the token in shared_prefs/
1 parent d577d5e commit 831234a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

api/src/processing/cookie/manager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const VALID_SERVICES = new Set([
1313
'reddit',
1414
'twitter',
1515
'youtube',
16+
'vimeo_bearer',
1617
]);
1718

1819
const invalidCookies = {};

api/src/processing/services/vimeo.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import HLS from "hls-parser";
22
import { env } from "../../config.js";
33
import { merge } from '../../misc/utils.js';
4+
import { getCookie } from "../cookie/manager.js";
45

56
const resolutionMatch = {
67
"3840": 2160,
@@ -25,7 +26,8 @@ const genericHeaders = {
2526
let bearer = '';
2627

2728
const getBearer = async (refresh = false) => {
28-
if (bearer && !refresh) return bearer;
29+
const cookie = getCookie('vimeo_bearer')?.values?.()?.access_token;
30+
if ((bearer || cookie) && !refresh) return bearer || cookie;
2931

3032
const oauthResponse = await fetch(
3133
'https://api.vimeo.com/oauth/authorize/client',

docs/examples/cookies.example.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
],
1414
"youtube": [
1515
"cookie=<replace_this>; b=<replace_this>"
16+
],
17+
"vimeo": [
18+
"access_token=<replace_this>"
1619
]
1720
}

0 commit comments

Comments
 (0)