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 <luan.lrt4@gmail.com>
This commit is contained in:
Armel Chesnais
2024-07-31 05:38:32 -04:00
committed by GitHub
parent a89a5ac2dd
commit 04369be620

View File

@@ -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;
}
}
}