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/
This commit is contained in:
zImPatrick
2025-09-24 18:27:13 +02:00
committed by GitHub
parent d577d5e451
commit 83a8da7151
3 changed files with 7 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ const VALID_SERVICES = new Set([
'reddit',
'twitter',
'youtube',
'vimeo_bearer',
]);
const invalidCookies = {};

View File

@@ -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',