mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-13 09:32:12 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user