From 04369be620e452ab3c4b2d14991fc55773995137 Mon Sep 17 00:00:00 2001 From: Armel Chesnais Date: Wed, 31 Jul 2024 05:38:32 -0400 Subject: [PATCH] fix(Player): Address changes introduced by player id `20dfca59` (#712) Fixes the nSig extract for YT player id `20dfca59 ` Handles: String.prototype.split.call(a,("","")) and Array.prototype.join.call(b, ("",""))}; Note the newline Co-authored-by: Luan --- src/core/Player.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Player.ts b/src/core/Player.ts index 739fdb85..6016d614 100644 --- a/src/core/Player.ts +++ b/src/core/Player.ts @@ -221,7 +221,7 @@ export default class Player { } static extractNSigSourceCode(data: string): string | undefined { - const match = data.match(/b=(?:a\.split\(|String\.prototype\.split\.call\(a,)""\).*?\}return (?:b\.join\(|Array\.prototype\.join\.call\(b,)""\)\}/s); + const match = data.match(/b=(?:a\.split\(|String\.prototype\.split\.call\(a,)\n?(?:""|\("",""\))\).*?\}return (?:b\.join\(|Array\.prototype\.join\.call\(b,)\n?(?:""|\("",""\))\)\}/s); // Don't throw an error here. if (!match) { @@ -239,4 +239,4 @@ export default class Player { static get LIBRARY_VERSION(): number { return 11; } -} \ No newline at end of file +}