From 83a8da715151f99c5674d9622820e5b3601c1ef1 Mon Sep 17 00:00:00 2001 From: zImPatrick Date: Wed, 24 Sep 2025 18:27:13 +0200 Subject: [PATCH] api/vimeo: add support for specifying access tokens (#1443) * 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/ --- api/src/processing/cookie/manager.js | 1 + api/src/processing/services/vimeo.js | 4 +++- docs/examples/cookies.example.json | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/processing/cookie/manager.js b/api/src/processing/cookie/manager.js index 9e23374b..cad11f77 100644 --- a/api/src/processing/cookie/manager.js +++ b/api/src/processing/cookie/manager.js @@ -13,6 +13,7 @@ const VALID_SERVICES = new Set([ 'reddit', 'twitter', 'youtube', + 'vimeo_bearer', ]); const invalidCookies = {}; diff --git a/api/src/processing/services/vimeo.js b/api/src/processing/services/vimeo.js index 8c51c026..c12269bc 100644 --- a/api/src/processing/services/vimeo.js +++ b/api/src/processing/services/vimeo.js @@ -1,6 +1,7 @@ import HLS from "hls-parser"; import { env } from "../../config.js"; import { merge } from '../../misc/utils.js'; +import { getCookie } from "../cookie/manager.js"; const resolutionMatch = { "3840": 2160, @@ -25,7 +26,8 @@ const genericHeaders = { let bearer = ''; const getBearer = async (refresh = false) => { - if (bearer && !refresh) return bearer; + const cookie = getCookie('vimeo_bearer')?.values?.()?.access_token; + if ((bearer || cookie) && !refresh) return bearer || cookie; const oauthResponse = await fetch( 'https://api.vimeo.com/oauth/authorize/client', diff --git a/docs/examples/cookies.example.json b/docs/examples/cookies.example.json index d788b2dd..4c467356 100644 --- a/docs/examples/cookies.example.json +++ b/docs/examples/cookies.example.json @@ -13,5 +13,8 @@ ], "youtube": [ "cookie=; b=" + ], + "vimeo": [ + "access_token=" ] }