Compare commits

...

3 Commits

Author SHA1 Message Date
jj
47d8ccbc17
api/package: bump to 11.5 2025-09-24 16:29:17 +00:00
jj
fc76e24996
api/package: bump youtubei.js to 15.1.1 2025-09-24 16:29:03 +00:00
zImPatrick
83a8da7151
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/
2025-09-24 18:27:13 +02:00
5 changed files with 15 additions and 8 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@imput/cobalt-api",
"description": "save what you love",
"version": "11.4.3",
"version": "11.5",
"author": "imput",
"exports": "./src/cobalt.js",
"type": "module",
@ -39,7 +39,7 @@
"set-cookie-parser": "2.6.0",
"undici": "^6.21.3",
"url-pattern": "1.0.3",
"youtubei.js": "15.0.1",
"youtubei.js": "15.1.1",
"zod": "^3.23.8"
},
"optionalDependencies": {

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

View File

@ -13,5 +13,8 @@
],
"youtube": [
"cookie=<replace_this>; b=<replace_this>"
],
"vimeo": [
"access_token=<replace_this>"
]
}

11
pnpm-lock.yaml generated
View File

@ -59,8 +59,8 @@ importers:
specifier: 1.0.3
version: 1.0.3
youtubei.js:
specifier: 15.0.1
version: 15.0.1
specifier: 15.1.1
version: 15.1.1
zod:
specifier: ^3.23.8
version: 3.23.8
@ -1876,6 +1876,7 @@ packages:
source-map@0.8.0-beta.0:
resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==}
engines: {node: '>= 8'}
deprecated: The work that was done in this beta branch won't be included in future versions
sprintf-js@1.0.3:
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
@ -2185,8 +2186,8 @@ packages:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
youtubei.js@15.0.1:
resolution: {integrity: sha512-2slapqJS5NuXKHvcACEknyVz0AjH/TrXaOhDM0q2twQKa54kCmfj+7B/2nGfd20uzAe29zW1ejk2qOc4ABuGkg==}
youtubei.js@15.1.1:
resolution: {integrity: sha512-fuEDj9Ky6cAQg93BrRVCbr+GTYNZQAIFZrx/a3oDRuGc3Mf5bS0dQfoYwwgjtSV7sgAKQEEdGtzRdBzOc8g72Q==}
zimmerframe@1.1.2:
resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==}
@ -4043,7 +4044,7 @@ snapshots:
yocto-queue@0.1.0: {}
youtubei.js@15.0.1:
youtubei.js@15.1.1:
dependencies:
'@bufbuild/protobuf': 2.2.5
jintr: 3.3.1