mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
youtube: add cookie support (#553)
This commit is contained in:
parent
268b6a40a3
commit
f6632e2d61
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ import { Innertube, Session } from 'youtubei.js';
|
||||||
import { env } from '../../config.js';
|
import { env } from '../../config.js';
|
||||||
import { cleanString } from '../../sub/utils.js';
|
import { cleanString } from '../../sub/utils.js';
|
||||||
import { fetch } from 'undici'
|
import { fetch } from 'undici'
|
||||||
|
import { getCookie } from '../cookie/manager.js'
|
||||||
|
|
||||||
const ytBase = Innertube.create().catch(e => e);
|
const ytBase = Innertube.create().catch(e => e);
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ const cloneInnertube = async (customFetch) => {
|
||||||
innertube.session.api_version,
|
innertube.session.api_version,
|
||||||
innertube.session.account_index,
|
innertube.session.account_index,
|
||||||
innertube.session.player,
|
innertube.session.player,
|
||||||
undefined,
|
getCookie('youtube'),
|
||||||
customFetch ?? innertube.session.http.fetch,
|
customFetch ?? innertube.session.http.fetch,
|
||||||
innertube.session.cache
|
innertube.session.cache
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue