diff --git a/play-dl/YouTube/index.ts b/play-dl/YouTube/index.ts index 586baaf..54f5d91 100644 --- a/play-dl/YouTube/index.ts +++ b/play-dl/YouTube/index.ts @@ -1,7 +1,6 @@ export { stream, stream_from_info, YouTubeStream } from './stream'; export * from './utils'; export { YouTube } from './search'; -export { cookieHeaders } from './utils/cookie'; export { YouTubeVideo } from './classes/Video' export { YouTubePlayList } from './classes/Playlist' export { YouTubeChannel } from './classes/Channel' diff --git a/play-dl/YouTube/utils/cookie.ts b/play-dl/YouTube/utils/cookie.ts index c391f7c..e4cf712 100644 --- a/play-dl/YouTube/utils/cookie.ts +++ b/play-dl/YouTube/utils/cookie.ts @@ -46,28 +46,3 @@ export function setCookieToken(options: { cookie: string }) { youtubeData = { cookie }; youtubeData.file = false; } -/** - * Updates cookies locally either in file or in memory. - * - * Example - * ```ts - * const response = ... // Any https package get function. - * - * play.cookieHeaders(response.headers['set-cookie']) - * ``` - * @param headCookie response headers['set-cookie'] array - * @returns Nothing - */ -export function cookieHeaders(headCookie: string[]): void { - if (!youtubeData?.cookie) return; - headCookie.forEach((x: string) => { - x.split(';').forEach((z) => { - const arr = z.split('='); - if (arr.length <= 1) return; - const key = arr.shift()?.trim() as string; - const value = arr.join('=').trim(); - setCookie(key, value); - }); - }); - uploadCookie(); -} diff --git a/play-dl/index.ts b/play-dl/index.ts index 3ca0ff4..082b46c 100644 --- a/play-dl/index.ts +++ b/play-dl/index.ts @@ -7,7 +7,6 @@ export { extractID, YouTube, YouTubeStream, - cookieHeaders, YouTubeChannel, YouTubePlayList, YouTubeVideo