From 6fe9372989ea89a0fdc4f77d0125657320da7c36 Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Tue, 23 Nov 2021 09:50:44 +0530 Subject: [PATCH] Removed useless function - cookiesHeaders --- play-dl/YouTube/index.ts | 1 - play-dl/YouTube/utils/cookie.ts | 25 ------------------------- play-dl/index.ts | 1 - 3 files changed, 27 deletions(-) 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