From 50b1583c275e89daa532ea481c1d4cdbcbcb2acc Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Fri, 7 Jan 2022 12:29:46 +0530 Subject: [PATCH] Fixed offensive videos error --- play-dl/YouTube/utils/extractor.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/play-dl/YouTube/utils/extractor.ts b/play-dl/YouTube/utils/extractor.ts index a4e8f27..930d38c 100644 --- a/play-dl/YouTube/utils/extractor.ts +++ b/play-dl/YouTube/utils/extractor.ts @@ -197,6 +197,11 @@ export async function video_basic_info(url: string, options: InfoOptions = {}): (res: any) => { if (res.compactVideoRenderer) related.push(`https://www.youtube.com/watch?v=${res.compactVideoRenderer.videoId}`); + if (res.itemSectionRenderer?.contents) + res.itemSectionRenderer.contents.forEach((x: any) => { + if (x.compactVideoRenderer) + related.push(`https://www.youtube.com/watch?v=${x.compactVideoRenderer.videoId}`); + }); } ); const microformat = player_response.microformat.playerMicroformatRenderer; @@ -553,6 +558,7 @@ async function acceptViewerDiscretion( }, setControvercy: true }), + cookies: true, cookieJar }); @@ -567,6 +573,7 @@ async function acceptViewerDiscretion( ['command', JSON.stringify(endpoint)], ['session_token', sessionToken] ]).toString(), + cookies: true, cookieJar });