From 193c6114659363e7ef82467cd2f466da97380953 Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Fri, 1 Oct 2021 12:08:46 +0530 Subject: [PATCH] Authentication Error fixes --- play-dl/YouTube/classes/LiveStream.ts | 4 ++-- play-dl/YouTube/utils/extractor.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/play-dl/YouTube/classes/LiveStream.ts b/play-dl/YouTube/classes/LiveStream.ts index 805613f..6815e54 100644 --- a/play-dl/YouTube/classes/LiveStream.ts +++ b/play-dl/YouTube/classes/LiveStream.ts @@ -134,7 +134,7 @@ export class Stream { private data_ended: boolean; private playing_count: number; private quality: number; - private proxy: Proxy[]; + private proxy: Proxy[] | undefined ; private request: IncomingMessage | null; constructor( url: string, @@ -148,7 +148,7 @@ export class Stream { this.stream = new PassThrough({ highWaterMark: 10 * 1000 * 1000 }); this.url = url; this.quality = options.quality as number; - this.proxy = options.proxy || []; + this.proxy = options.proxy || undefined; this.type = type; this.bytes_count = 0; this.video_url = video_url; diff --git a/play-dl/YouTube/utils/extractor.ts b/play-dl/YouTube/utils/extractor.ts index cda92e7..ba9650f 100644 --- a/play-dl/YouTube/utils/extractor.ts +++ b/play-dl/YouTube/utils/extractor.ts @@ -67,7 +67,7 @@ export async function video_basic_info(url: string, options: InfoOptions = {}) { } else video_id = url; const new_url = `https://www.youtube.com/watch?v=${video_id}&has_verified=1`; const body = await request(new_url, { - proxies: options.proxy ?? [], + proxies: options.proxy ?? undefined, headers: options.cookie ? { 'cookie': options.cookie, @@ -185,7 +185,7 @@ export async function playlist_info(url: string, options: PlaylistOptions = {}): const new_url = `https://www.youtube.com/playlist?list=${Playlist_id}`; const body = await request(new_url, { - proxies: options.proxy ?? [], + proxies: options.proxy ?? undefined, headers: { 'accept-language': 'en-US,en-IN;q=0.9,en;q=0.8,hi;q=0.7' } }); const response = JSON.parse(body.split('var ytInitialData = ')[1].split(';')[0]);