youtube: add cookie support (#553)

This commit is contained in:
jj 2024-06-07 15:02:07 +02:00 committed by GitHub
parent 268b6a40a3
commit f6632e2d61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@ import { Innertube, Session } from 'youtubei.js';
import { env } from '../../config.js';
import { cleanString } from '../../sub/utils.js';
import { fetch } from 'undici'
import { getCookie } from '../cookie/manager.js'
const ytBase = Innertube.create().catch(e => e);
@ -35,7 +36,7 @@ const cloneInnertube = async (customFetch) => {
innertube.session.api_version,
innertube.session.account_index,
innertube.session.player,
undefined,
getCookie('youtube'),
customFetch ?? innertube.session.http.fetch,
innertube.session.cache
);