mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Replace deprecated querystring with URLSearchParams
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { URL } from 'node:url';
|
import { URL, URLSearchParams } from 'node:url';
|
||||||
import { request } from './../../Request';
|
import { request } from './../../Request';
|
||||||
import querystring from 'node:querystring';
|
|
||||||
|
|
||||||
interface formatOptions {
|
interface formatOptions {
|
||||||
url?: string;
|
url?: string;
|
||||||
@@ -164,7 +163,8 @@ export async function format_decipher(formats: formatOptions[], html5player: str
|
|||||||
formats.forEach((format) => {
|
formats.forEach((format) => {
|
||||||
const cipher = format.signatureCipher || format.cipher;
|
const cipher = format.signatureCipher || format.cipher;
|
||||||
if (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.signatureCipher;
|
||||||
delete format.cipher;
|
delete format.cipher;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user