Removed useless function - cookiesHeaders
This commit is contained in:
parent
c24b417f39
commit
6fe9372989
@ -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'
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ export {
|
||||
extractID,
|
||||
YouTube,
|
||||
YouTubeStream,
|
||||
cookieHeaders,
|
||||
YouTubeChannel,
|
||||
YouTubePlayList,
|
||||
YouTubeVideo
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user