From 6d5de7463db8b0136275ecb547aa1a607ab6976b Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Thu, 28 Oct 2021 21:09:13 +0200 Subject: [PATCH] Replace deprecated querystring with URLSearchParams --- play-dl/YouTube/utils/cipher.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/play-dl/YouTube/utils/cipher.ts b/play-dl/YouTube/utils/cipher.ts index c1e7f94..b2bf2f7 100644 --- a/play-dl/YouTube/utils/cipher.ts +++ b/play-dl/YouTube/utils/cipher.ts @@ -1,6 +1,5 @@ -import { URL } from 'node:url'; +import { URL, URLSearchParams } from 'node:url'; import { request } from './../../Request'; -import querystring from 'node:querystring'; interface formatOptions { url?: string; @@ -164,7 +163,8 @@ export async function format_decipher(formats: formatOptions[], html5player: str formats.forEach((format) => { const cipher = format.signatureCipher || format.cipher; if (cipher) { - Object.assign(format, querystring.parse(cipher)); + const params = Object.fromEntries(new URLSearchParams(cipher)); + Object.assign(format, params); delete format.signatureCipher; delete format.cipher; }