diff --git a/src/utils.ts b/src/utils.ts index 9580668..c1f4af4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -import { type ESTree } from "meriyah"; +import { parse, type ESTree } from "meriyah"; import { type DeepPartial } from "./types.ts"; export function matchesStructure( @@ -42,3 +42,10 @@ export function matchesStructure( export function isOneOf(value: unknown, ...of: readonly T[]): value is T { return of.includes(value as T); } + +export function generateArrowFunction( + data: string, +): ESTree.ArrowFunctionExpression { + return (parse(data).body[0] as ESTree.ExpressionStatement) + .expression as ESTree.ArrowFunctionExpression; +} diff --git a/src/yt/solver/n.ts b/src/yt/solver/n.ts deleted file mode 100644 index f4adbce..0000000 --- a/src/yt/solver/n.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { type ESTree } from "meriyah"; -import { matchesStructure } from "../../utils.ts"; -import { type DeepPartial } from "../../types.ts"; - -const identifier: DeepPartial = { - or: [ - { - type: "VariableDeclaration", - kind: "var", - declarations: { - anykey: [ - { - type: "VariableDeclarator", - id: { - type: "Identifier", - }, - init: { - type: "ArrayExpression", - elements: [ - { - type: "Identifier", - }, - ], - }, - }, - ], - }, - }, - { - type: "ExpressionStatement", - expression: { - type: "AssignmentExpression", - left: { - type: "Identifier", - }, - operator: "=", - right: { - type: "ArrayExpression", - elements: [ - { - type: "Identifier", - }, - ], - }, - }, - }, - ], -} as const; - -const catchBlockBody = [ - { - type: "ReturnStatement", - argument: { - type: "BinaryExpression", - left: { - type: "MemberExpression", - object: { - type: "Identifier", - }, - computed: true, - property: { - type: "Literal", - }, - optional: false, - }, - right: { - type: "Identifier", - }, - operator: "+", - }, - }, -] as const; - -export function extract( - node: ESTree.Node, -): ESTree.ArrowFunctionExpression | null { - if (!matchesStructure(node, identifier)) { - // Fallback search for try { } catch { return X[12] + Y } - let name: string | undefined | null = null; - let block: ESTree.BlockStatement | null | undefined = null; - switch (node.type) { - case "ExpressionStatement": { - if ( - node.expression.type === "AssignmentExpression" && - node.expression.left.type === "Identifier" && - node.expression.right.type === "FunctionExpression" && - node.expression.right.params.length === 1 - ) { - name = node.expression.left.name; - block = node.expression.right.body; - } - break; - } - case "FunctionDeclaration": { - if (node.params.length === 1) { - name = node.id?.name; - block = node.body; - } - break; - } - } - if (!block || !name) { - return null; - } - const tryNode = block.body.at(-2); - if ( - tryNode?.type !== "TryStatement" || - tryNode.handler?.type !== "CatchClause" - ) { - return null; - } - const catchBody = tryNode.handler!.body.body; - if (matchesStructure(catchBody, catchBlockBody)) { - return makeSolverFuncFromName(name); - } - return null; - } - - if (node.type === "VariableDeclaration") { - for (const declaration of node.declarations) { - if ( - declaration.type !== "VariableDeclarator" || - !declaration.init || - declaration.init.type !== "ArrayExpression" || - declaration.init.elements.length !== 1 - ) { - continue; - } - const [firstElement] = declaration.init.elements; - if (firstElement && firstElement.type === "Identifier") { - return makeSolverFuncFromName(firstElement.name); - } - } - } else if (node.type === "ExpressionStatement") { - const expr = node.expression; - if ( - expr.type === "AssignmentExpression" && - expr.left.type === "Identifier" && - expr.operator === "=" && - expr.right.type === "ArrayExpression" && - expr.right.elements.length === 1 - ) { - const [firstElement] = expr.right.elements; - if (firstElement && firstElement.type === "Identifier") { - return makeSolverFuncFromName(firstElement.name); - } - } - } - return null; -} - -function makeSolverFuncFromName(name: string): ESTree.ArrowFunctionExpression { - return { - type: "ArrowFunctionExpression", - params: [ - { - type: "Identifier", - name: "n", - }, - ], - body: { - type: "CallExpression", - callee: { - type: "Identifier", - name: name, - }, - arguments: [ - { - type: "Identifier", - name: "n", - }, - ], - optional: false, - }, - async: false, - expression: false, - generator: false, - }; -} diff --git a/src/yt/solver/nsig.ts b/src/yt/solver/nsig.ts new file mode 100644 index 0000000..649b8dc --- /dev/null +++ b/src/yt/solver/nsig.ts @@ -0,0 +1,143 @@ +import { type ESTree } from "meriyah"; +import { generate } from "astring"; +import { matchesStructure, generateArrowFunction } from "../../utils.ts"; +import { type DeepPartial } from "../../types.ts"; + +const identifier: DeepPartial = { + or: [ + { + type: "ExpressionStatement", + expression: { + type: "AssignmentExpression", + operator: "=", + left: { + or: [{ type: "Identifier" }, { type: "MemberExpression" }], + }, + right: { + type: "FunctionExpression", + async: false, + }, + }, + }, + { + type: "FunctionDeclaration", + async: false, + id: { type: "Identifier" }, + }, + { + type: "VariableDeclaration", + declarations: { + anykey: [ + { + type: "VariableDeclarator", + init: { + type: "FunctionExpression", + async: false, + }, + }, + ], + }, + }, + ], +} as const; + +const asdasd: DeepPartial = { + type: "ExpressionStatement", + expression: { + type: "CallExpression", + callee: { + type: "MemberExpression", + object: { type: "Identifier" }, + property: {}, + optional: false, + }, + arguments: [ + { + type: "Literal", + value: "alr", + }, + { + type: "Literal", + value: "yes", + }, + ], + optional: false, + }, +}; + +export function extract( + node: ESTree.Node, +): ESTree.ArrowFunctionExpression | null { + if (!matchesStructure(node, identifier)) { + return null; + } + + const options: { + name: ESTree.Expression; + statements: ESTree.Statement[]; + }[] = []; + + if (node.type === "FunctionDeclaration") { + if (node.id && node.body?.body) { + options.push({ + name: node.id, + statements: node.body?.body, + }); + } + } else if (node.type === "ExpressionStatement") { + if (node.expression.type !== "AssignmentExpression") { + return null; + } + const name = node.expression.left; + const body = (node.expression.right as ESTree.FunctionExpression)?.body + ?.body; + if (name && body) { + options.push({ + name: name, + statements: body, + }); + } + } else if (node.type === "VariableDeclaration") { + for (const declaration of node.declarations) { + const name = declaration.id; + const body = (declaration.init as ESTree.FunctionExpression)?.body?.body; + if (name && body) { + options.push({ + name: name, + statements: body, + }); + } + } + } + + for (const { name, statements } of options) { + if (matchesStructure(statements, { anykey: [asdasd] })) { + return createSolver(name); + } + } + return null; +} + +function createSolver( + expression: ESTree.Expression, +): ESTree.ArrowFunctionExpression { + return generateArrowFunction(` +({sig, n}) => { + const url = (${generate(expression)})("https://youtube.com/watch?v=yt-dlp-wins", "s", sig); + url.set("n", n); + const proto = Object.getPrototypeOf(url); + const keys = Object.keys(proto).concat(Object.getOwnPropertyNames(proto)); + for (const key of keys) { + if (!["constructor", "set", "get", "clone"].includes(key)) { + url[key](); + break; + } + } + const s = url.get("s"); + return { + sig: s ? decodeURIComponent(s) : null, + n: url.get("n") ?? null, + }; +} +`); +} diff --git a/src/yt/solver/sig.ts b/src/yt/solver/sig.ts deleted file mode 100644 index c700b45..0000000 --- a/src/yt/solver/sig.ts +++ /dev/null @@ -1,289 +0,0 @@ -import { type ESTree } from "meriyah"; -import { matchesStructure } from "../../utils.ts"; -import { type DeepPartial } from "../../types.ts"; - -const nsig: DeepPartial = { - type: "CallExpression", - callee: { - or: [{ type: "Identifier" }, { type: "SequenceExpression" }], - }, - arguments: [ - {}, - { - type: "CallExpression", - callee: { - type: "Identifier", - name: "decodeURIComponent", - }, - arguments: [{}], - }, - ], -}; -const nsigAssignment: DeepPartial = { - type: "AssignmentExpression", - left: { type: "Identifier" }, - operator: "=", - right: nsig, -}; -const nsigDeclarator: DeepPartial = { - type: "VariableDeclarator", - id: { type: "Identifier" }, - init: nsig, -}; - -const logicalExpression: DeepPartial = { - type: "ExpressionStatement", - expression: { - type: "LogicalExpression", - left: { - type: "Identifier", - }, - right: { - type: "SequenceExpression", - expressions: [ - { - type: "AssignmentExpression", - left: { - type: "Identifier", - }, - operator: "=", - right: { - type: "CallExpression", - callee: { - type: "Identifier", - }, - arguments: { - or: [ - [ - { - type: "CallExpression", - callee: { - type: "Identifier", - name: "decodeURIComponent", - }, - arguments: [{ type: "Identifier" }], - optional: false, - }, - ], - [ - { type: "Literal" }, - { - type: "CallExpression", - callee: { - type: "Identifier", - name: "decodeURIComponent", - }, - arguments: [{ type: "Identifier" }], - optional: false, - }, - ], - [ - { type: "Literal" }, - { type: "Literal" }, - { - type: "CallExpression", - callee: { - type: "Identifier", - name: "decodeURIComponent", - }, - arguments: [{ type: "Identifier" }], - optional: false, - }, - ], - ], - }, - optional: false, - }, - }, - { - type: "CallExpression", - }, - ], - }, - operator: "&&", - }, -}; - -const identifier: DeepPartial = { - or: [ - { - type: "ExpressionStatement", - expression: { - type: "AssignmentExpression", - operator: "=", - left: { - or: [{ type: "Identifier" }, { type: "MemberExpression" }], - }, - right: { - type: "FunctionExpression", - }, - }, - }, - { - type: "FunctionDeclaration", - }, - { - type: "VariableDeclaration", - declarations: { - anykey: [ - { - type: "VariableDeclarator", - init: { - type: "FunctionExpression", - }, - }, - ], - }, - }, - ], -} as const; - -export function extract( - node: ESTree.Node, -): ESTree.ArrowFunctionExpression | null { - const blocks: ESTree.BlockStatement[] = []; - - if (matchesStructure(node, identifier)) { - if ( - node.type === "ExpressionStatement" && - node.expression.type === "AssignmentExpression" && - node.expression.right.type === "FunctionExpression" && - node.expression.right.params.length >= 3 - ) { - blocks.push(node.expression.right.body!); - } else if (node.type === "VariableDeclaration") { - for (const decl of node.declarations) { - if ( - decl.init?.type === "FunctionExpression" && - decl.init.params.length >= 3 - ) { - blocks.push(decl.init.body!); - } - } - } else if (node.type === "FunctionDeclaration" && node.params.length >= 3) { - blocks.push(node.body!); - } else { - return null; - } - } else if ( - node.type === "ExpressionStatement" && - node.expression.type === "SequenceExpression" - ) { - for (const expr of node.expression.expressions) { - if ( - expr.type === "AssignmentExpression" && - expr.right.type === "FunctionExpression" && - expr.right.params.length === 3 - ) { - blocks.push(expr.right.body as ESTree.BlockStatement); - } - } - } else { - return null; - } - - for (const block of blocks) { - let call: ESTree.CallExpression | null = null; - - for (const stmt of block.body) { - if (matchesStructure(stmt, logicalExpression)) { - // legacy matching - if ( - stmt.type === "ExpressionStatement" && - stmt.expression.type === "LogicalExpression" && - stmt.expression.right.type === "SequenceExpression" && - stmt.expression.right.expressions[0].type === - "AssignmentExpression" && - stmt.expression.right.expressions[0].right.type === "CallExpression" - ) { - call = stmt.expression.right.expressions[0].right; - } - } else if (stmt.type === "IfStatement") { - // if (...) { var a, b = (0, c)(1, decodeURIComponent(...))} - let consequent = stmt.consequent; - while (consequent.type === "LabeledStatement") { - consequent = consequent.body; - } - if (consequent.type !== "BlockStatement") { - continue; - } - - for (const n of consequent.body) { - if (n.type !== "VariableDeclaration") { - continue; - } - for (const decl of n.declarations) { - if ( - matchesStructure(decl, nsigDeclarator) && - decl.init?.type === "CallExpression" - ) { - call = decl.init; - break; - } - } - if (call) { - break; - } - } - } else if (stmt.type === "ExpressionStatement") { - // (...) && ((...), (c = (...)(decodeURIComponent(...)))) - if ( - stmt.expression.type !== "LogicalExpression" || - stmt.expression.operator !== "&&" || - stmt.expression.right.type !== "SequenceExpression" - ) { - continue; - } - for (const expr of stmt.expression.right.expressions) { - if (matchesStructure(expr, nsigAssignment) && expr.type) { - if ( - expr.type === "AssignmentExpression" && - expr.right.type === "CallExpression" - ) { - call = expr.right; - break; - } - } - } - } - if (call) { - break; - } - } - - if (!call) { - continue; - } - - // TODO: verify identifiers here - return { - type: "ArrowFunctionExpression", - params: [ - { - type: "Identifier", - name: "sig", - }, - ], - body: { - type: "CallExpression", - callee: call.callee, - arguments: call.arguments.map((arg): ESTree.Expression => { - if ( - arg.type === "CallExpression" && - arg.callee.type === "Identifier" && - arg.callee.name === "decodeURIComponent" - ) { - return { type: "Identifier", name: "sig" }; - } - return arg as unknown as ESTree.Expression; - }), - optional: false, - }, - async: false, - expression: false, - generator: false, - }; - } - - return null; -} diff --git a/src/yt/solver/solvers.ts b/src/yt/solver/solvers.ts index 00245de..2b7caf6 100755 --- a/src/yt/solver/solvers.ts +++ b/src/yt/solver/solvers.ts @@ -1,8 +1,8 @@ import { type ESTree, parse } from "meriyah"; import { generate } from "astring"; -import { extract as extractSig } from "./sig.ts"; -import { extract as extractN } from "./n.ts"; +import { extract } from "./nsig.ts"; import { setupNodes } from "./setup.ts"; +import { generateArrowFunction } from "../../utils.ts"; export function preprocessPlayer(data: string): string { const program = parse(data); @@ -92,18 +92,65 @@ export function getSolutions( sig: [] as ESTree.ArrowFunctionExpression[], }; for (const statement of statements) { - const n = extractN(statement); - if (n) { - found.n.push(n); - } - const sig = extractSig(statement); - if (sig) { - found.sig.push(sig); + const result = extract(statement); + if (result) { + found.n.push( + makeSolver(result, { + type: "Identifier", + name: "n", + }), + ); + found.sig.push( + makeSolver(result, { + type: "Identifier", + name: "sig", + }), + ); } } return found; } +function makeSolver( + result: ESTree.ArrowFunctionExpression, + ident: ESTree.Identifier, +): ESTree.ArrowFunctionExpression { + return { + type: "ArrowFunctionExpression", + params: [ident], + body: { + type: "MemberExpression", + object: { + type: "CallExpression", + callee: result, + arguments: [ + { + type: "ObjectExpression", + properties: [ + { + type: "Property", + key: ident, + value: ident, + kind: "init", + computed: false, + method: false, + shorthand: true, + }, + ], + }, + ], + optional: false, + }, + computed: false, + property: ident, + optional: false, + }, + async: false, + expression: true, + generator: false, + }; +} + export function getFromPrepared(code: string): { n: ((val: string) => string) | null; sig: ((val: string) => string) | null; @@ -116,289 +163,25 @@ export function getFromPrepared(code: string): { function multiTry( generators: ESTree.ArrowFunctionExpression[], ): ESTree.ArrowFunctionExpression { - return { - type: "ArrowFunctionExpression", - params: [ - { - type: "Identifier", - name: "_input", - }, - ], - body: { - type: "BlockStatement", - body: [ - { - type: "VariableDeclaration", - kind: "const", - declarations: [ - { - type: "VariableDeclarator", - id: { - type: "Identifier", - name: "_results", - }, - init: { - type: "NewExpression", - callee: { - type: "Identifier", - name: "Set", - }, - arguments: [], - }, - }, - ], - }, - { - type: "ForOfStatement", - left: { - type: "VariableDeclaration", - kind: "const", - declarations: [ - { - type: "VariableDeclarator", - id: { - type: "Identifier", - name: "_generator", - }, - init: null, - }, - ], - }, - right: { - type: "ArrayExpression", - elements: generators, - }, - body: { - type: "BlockStatement", - body: [ - { - type: "TryStatement", - block: { - type: "BlockStatement", - body: [ - { - type: "ExpressionStatement", - expression: { - type: "CallExpression", - callee: { - type: "MemberExpression", - object: { - type: "Identifier", - name: "_results", - }, - computed: false, - property: { - type: "Identifier", - name: "add", - }, - optional: false, - }, - arguments: [ - { - type: "CallExpression", - callee: { - type: "Identifier", - name: "_generator", - }, - arguments: [ - { - type: "Identifier", - name: "_input", - }, - ], - optional: false, - }, - ], - optional: false, - }, - }, - ], - }, - handler: { - type: "CatchClause", - param: null, - body: { - type: "BlockStatement", - body: [], - }, - }, - finalizer: null, - }, - ], - }, - await: false, - }, - { - type: "IfStatement", - test: { - type: "UnaryExpression", - operator: "!", - argument: { - type: "MemberExpression", - object: { - type: "Identifier", - name: "_results", - }, - computed: false, - property: { - type: "Identifier", - name: "size", - }, - optional: false, - }, - prefix: true, - }, - consequent: { - type: "BlockStatement", - body: [ - { - type: "ThrowStatement", - argument: { - type: "TemplateLiteral", - expressions: [], - quasis: [ - { - type: "TemplateElement", - value: { - cooked: "no solutions", - raw: "no solutions", - }, - tail: true, - }, - ], - }, - }, - ], - }, - alternate: null, - }, - { - type: "IfStatement", - test: { - type: "BinaryExpression", - left: { - type: "MemberExpression", - object: { - type: "Identifier", - name: "_results", - }, - computed: false, - property: { - type: "Identifier", - name: "size", - }, - optional: false, - }, - right: { - type: "Literal", - value: 1, - }, - operator: "!==", - }, - consequent: { - type: "BlockStatement", - body: [ - { - type: "ThrowStatement", - argument: { - type: "TemplateLiteral", - expressions: [ - { - type: "CallExpression", - callee: { - type: "MemberExpression", - object: { - type: "Identifier", - name: "_results", - }, - computed: false, - property: { - type: "Identifier", - name: "join", - }, - optional: false, - }, - arguments: [ - { - type: "Literal", - value: ", ", - }, - ], - optional: false, - }, - ], - quasis: [ - { - type: "TemplateElement", - value: { - cooked: "invalid solutions: ", - raw: "invalid solutions: ", - }, - tail: false, - }, - { - type: "TemplateElement", - value: { - cooked: "", - raw: "", - }, - tail: true, - }, - ], - }, - }, - ], - }, - alternate: null, - }, - { - type: "ReturnStatement", - argument: { - type: "MemberExpression", - object: { - type: "CallExpression", - callee: { - type: "MemberExpression", - object: { - type: "CallExpression", - callee: { - type: "MemberExpression", - object: { - type: "Identifier", - name: "_results", - }, - computed: false, - property: { - type: "Identifier", - name: "values", - }, - optional: false, - }, - arguments: [], - optional: false, - }, - computed: false, - property: { - type: "Identifier", - name: "next", - }, - optional: false, - }, - arguments: [], - optional: false, - }, - computed: false, - property: { - type: "Identifier", - name: "value", - }, - optional: false, - }, - }, - ], - }, - async: false, - expression: false, - generator: false, - }; + return generateArrowFunction(` +(_input) => { + const _results = new Set(); + for (const _generator of ${generate({ + type: "ArrayExpression", + elements: generators, + } as ESTree.Node)}) { + try { + _results.add(_generator(_input)); + } catch (e) { + } + } + if (!_results.size) { + throw "no solutions"; + } + if (_results.size !== 1) { + throw \`invalid solutions: \${[..._results].map(x => JSON.stringify(x)).join(", ")}\`; + } + return _results.values().next().value; +} +`); } diff --git a/src/yt/solver/test/download.ts b/src/yt/solver/test/download.ts index 787635d..b4361d1 100644 --- a/src/yt/solver/test/download.ts +++ b/src/yt/solver/test/download.ts @@ -4,6 +4,10 @@ import { downloadCached } from "./utils.ts"; for (const test of tests) { const variants = test.variants ?? players.keys(); for (const variant of variants) { - await downloadCached(test.player, variant); + try { + await downloadCached(test.player, variant); + } catch (e) { + console.error(e); + } } } diff --git a/src/yt/solver/test/tests.ts b/src/yt/solver/test/tests.ts index 85afd6e..1dbb083 100644 --- a/src/yt/solver/test/tests.ts +++ b/src/yt/solver/test/tests.ts @@ -10,476 +10,70 @@ export const tests: { sig?: Step[]; }[] = [ { - player: "3d3ba064", - n: [ - { input: "ZdZIqFPQK-Ty8wId", expected: "qmtUsIz04xxiNW" }, - { input: "4GMrWHyKI5cEvhDO", expected: "N9gmEX7YhKTSmw" }, - ], - sig: [ - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "ttJC2JfQdSswRAIgGBCxZyAfKyi0cjXCb3gqEctUw-NYdNmOEvaepit0zJAtIEsgOV2SXZjhSHMNy0NXNG_1kNyBf6HPuAuCduh-a7O", - }, - ], - }, - { - player: "5ec65609", - n: [{ input: "0eRGgQWJGfT5rFHFj", expected: "4SvMpDQH-vBJCw" }], - sig: [ - { - input: - "AAJAJfQdSswRQIhAMG5SN7-cAFChdrE7tLA6grH0rTMICA1mmDc0HoXgW3CAiAQQ4=CspfaF_vt82XH5yewvqcuEkvzeTsbRuHssRMyJQ=I", - expected: - "AJfQdSswRQIhAMG5SN7-cAFChdrE7tLA6grI0rTMICA1mmDc0HoXgW3CAiAQQ4HCspfaF_vt82XH5yewvqcuEkvzeTsbRuHssRMyJQ==", - }, - ], - }, - { - player: "6742b2b9", - n: [ - { input: "_HPB-7GFg1VTkn9u", expected: "qUAsPryAO_ByYg" }, - { input: "K1t_fcB6phzuq2SF", expected: "Y7PcOt3VE62mog" }, - ], - sig: [ - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "AJfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYu7S6SHM8EjoCACIEQnz-nKN5RgG6iUTnNJC58csYPSrnS_SzricuUMJZGM", - }, - ], - }, - { - player: "23ccdd25", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "orSsTqUaUO-j" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "ZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hAU6wbTvorvVVMgIARwsSdQfJAN", - }, - ], - }, - { - player: "3597727b", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "PRwo5dDfisg0ejA2" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "AAJfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYuMS6SHM8Ej7CACIEQnz-nKN5RgG6iUTnNJC58csYPSroS_SzricuUMJZG", - }, - ], - }, - { - // tce causes exception even in browser - player: "3752a005", - variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone"], - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - }, - ], - }, - { - // tce causes exception even in browser - player: "afc7785b", - variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone"], - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - }, - ], - }, - { - // tce causes exception even in browser - player: "b9645327", - variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone"], - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - }, - ], - }, - { - // tce causes exception even in browser - player: "035b9195", - variants: ["main", "tcc", "es5", "es6", "tv", "tv_es6", "phone"], - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "j22ZtsqVsR0Dn" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "ZJM_ucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHG6S7uYq4TGjQXSD4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - }, - ], - }, - { - player: "6740c111", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "AVsXYE0uE1k8e" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "JfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYu7S6SHM8EjoCACIEQnz-MKN5RgG6iUTnNJC58csYPSrnS_SzricuUMJZGn", - }, - ], - }, - { - player: "f6a4f3bc", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "H1NKYFbhlqZ" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "JfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYM7S6SHM8EjoCACIEQnz-nKM5RgG6iUTnNJC58cNYPSrnS_SzricuUMJZGu", - }, - ], - }, - { - player: "b66835e2", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "H1NKYFbhlqZ" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "JfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYM7S6SHM8EjoCACIEQnz-nKM5RgG6iUTnNJC58cNYPSrnS_SzricuUMJZGu", - }, - ], - }, - { - player: "4f8fa943", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "JWWr7hDSRpMq5" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "AAJfQdSswRAIgMVVvrovTbw6UNh99kPa4D_XQjGT4qYu7S6SHr8EjoCACIEQnz-nKN5RgG6iUTnNZC58csYPSMnS_SzricuUM", - }, - ], - }, - { - player: "0004de42", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "OPd7UEsCDmCw4qD0" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJAA", - expected: - "ZJMUucirzS_SnrSPYsc85MJNnTUi6GgR5NCn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQ", - }, - ], - }, - { - player: "2b83d2e0", - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "euHbygrCMLksxd" }, - ], - sig: [ - // Synthetic test - { - input: - "MMGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKn-znQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJA", - expected: - "-MGZJMUucirzS_SnrSPYsc85CJNnTUi6GgR5NKnMznQEICACojE8MHS6S7uYq4TGjQX_D4aPk99hNU6wbTvorvVVMgIARwsSdQfJ", - }, - ], - }, - { - player: "638ec5c6", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "1qov8-KM-yH" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "MhudCuAuP-6fByOk1_GNXN7gNHHShjyXS2VOgsEItAJz0tipeav0OmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - }, - ], - }, - { - player: "87644c66", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "iF5NxEm1BYk" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "atJC2JfQdSswRAtgGBCxZyAfKyi0cjXCb3DqEctUw-NYdNmOEvIepit0zJAtIEsgOV2SXZjhSHMNy0NXNG_1kOyBf6HPuAuCduh-a7Ng", - }, - ], - }, - { - // tce variant broke sig solving; n and other variants are added only for regression testing - player: "c1c87fb0", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "jCHBK5GuAFNa2" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "ttJC2JfQdSswRAIgGBCxZyAfKyi0cjXCb3DqEctUw-NYdNmOEvaepit0zJAtIEsgOV2SXZjhSHMNy0NXNGa1kOyBf6HPuAuCduh-_", - }, - ], - }, - { - player: "4e51e895", - variants: ["main"], - n: [ - // Synthetic test - { input: "0eRGgQWJGfT5rFHFj", expected: "t5kO23_msekBur" }, - ], - sig: [ - { - // Synthetic test - input: - "AL6p_8AwdY9yAhRzK8rYA_9n97Kizf7_9n97Kizf7_9n97Kizf7_9n97Kizf7_9n97Kizf7_9n97Kizf7", - expected: - "AwdY9yAhRzK8rYA_9n97Kizf7_9n97Kizf7_9n9pKizf7_9n97Kizf7_9n97Kizf7_9n97Kizf7", - }, - ], - }, - { - // sig: tce: deep if: multiple matching but giving same solution - player: "42c5570b", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "CRoXjB-R-R" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "EN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavcOmNdYN-wUtgEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - }, - ], - }, - { - // sig: tce: deep if - player: "ed3f6ea5", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "CRoXjB-R-R" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "EN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavcOmNdYN-wUtgEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - }, - ], - }, - { - // sig: tce: deep if: another, similar structure using && instead of if - player: "d6afc319", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "5RA1UjcYMe33HCQ" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXt2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtS", - }, - ], - }, - { - // sig: tce: deep if - player: "8da75a6a", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "Q3JvBQziA7PvI" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "g7aNhudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyJxCBGgIARwsSdQfJ2CZ", - }, - ], - }, - { - // sig: tce: call with 3 parameters - player: "54bd1de4", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "ka-slAQ31sijFN" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0titeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtp", - }, - ], - }, - { - // sig: tce: call with 3 parameters - player: "f104ea90", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "n5DnuOYzgrSUbWp" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "fJC2JtQdSswRAIgGBCxZyAfKyi0cjXCb3DqEctUw-NYdNmOEZaepit0z7AtIEsgOV2SX-jhSHMNy0NXNG_1kOyBf6HPuAuCduhv", - }, - ], - }, - { - // sig: tce: call with 3 parameters - player: "3510b6ff", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "n5DnuOYzgrSUbWp" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "fJC2JtQdSswRAIgGBCxZyAfKyi0cjXCb3DqEctUw-NYdNmOEZaepit0z7AtIEsgOV2SX-jhSHMNy0NXNG_1kOyBf6HPuAuCduhv", - }, - ], - }, - { - // sig: tce: call with 3 parameters - player: "0675bd00", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "n5DnuOYzgrSUbWp" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "fJC2JtQdSswRAIgGBCxZyAfKyi0cjXCb3DqEctUw-NYdNmOEZaepit0z7AtIEsgOV2SX-jhSHMNy0NXNG_1kOyBf6HPuAuCduhv", - }, - ], - }, - { - // sig: tce: call with 3 parameters - player: "e0528946", - n: [ - // Synthetic test - { input: "ZdZIqFPQK-Ty8wId", expected: "cGKEGBME8PGi7z" }, - ], - sig: [ - // Synthetic test - { - input: - "gN7a-hudCuAuPH6fByOk1_GNXN0yNMHShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2CJtt", - expected: - "7a-hudCuAuPH6fByOk1_GNXN0yNMgShjZXS2VOgsEItAJz0tipeavEOmNdYN-wUtcEqD3bCXjc0iyKfAyZxCBGgIARwsSdQfJ2C", - }, - ], - }, - { - // sig: es6: call with 3 parameters - player: "94667337", - n: [{ input: "BQoJvGBkC2nj1ZZLK-", expected: "ib1ShEOGoFXIIw" }], + // 20518 + player: "edc3ba07", + n: [{ input: "BQoJvGBkC2nj1ZZLK-", expected: "-m-se9fQVnvEofLx" }], sig: [ { input: "NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz", expected: - "AJEij0EwRgIhAI0KExTgjfPk-MPM9MNdzyyPRtzBM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=", + "zwg=wgwCHlydB9zg7PMegXoVzaoAXXB8woPSNZqRUC3Pe7vAEiApVSCMlh5mt5OX-8MB=tRPyyEdAM9MPM-kPfjgTxEK0IAhIgRwE0jiz", + }, + ], + }, + { + // 20521 + player: "316b61b4", + n: [{ input: "IlLiA21ny7gqA2m4p37", expected: "GchRcsUC_WmnhOUVGV" }], + sig: [ + { + input: + "NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz", + expected: + "tJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRN=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwz", + }, + ], + }, + { + // 20522 + player: "74edf1a3", + n: [ + { input: "IlLiA21ny7gqA2m4p37", expected: "9nRTxrbM1f0yHg" }, + { input: "eabGFpsUKuWHXGh6FR4", expected: "izmYqDEY6kl7Sg" }, + ], + sig: [ + { + input: + "NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz", + expected: + "NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hzMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzl", + }, + ], + }, + { + // 20523 + player: "901741ab", + n: [{ input: "BQoJvGBkC2nj1ZZLK-", expected: "UMPovvBZRh-sjb" }], + sig: [ + { + input: + "NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz", + expected: + "wgwCHlydB9Hg7PMegXoVzaoAXXB8woPSNZqRUC3Pe7vAEiApVSCMlhwmt5ON-8MB=5RPyyzdAM9MPM-kPfjgTxEK0IAhIgRwE0jiEJA", + }, + ], + }, + { + // 20524 + player: "e7573094", + n: [{ input: "IlLiA21ny7gqA2m4p37", expected: "3KuQ3235dojTSjo4" }], + sig: [ + { + input: + "NJAJEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyyPRt=BM8-XO5tm5hlMCSVpAiEAv7eP3CURqZNSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=gwzz", + expected: + "yEij0EwRgIhAI0KExTgjfPk-MPM9MAdzyNPRt=BM8-XO5tm5hlMCSVNAiEAvpeP3CURqZJSPow8BXXAoazVoXgeMP7gH9BdylHCwgw=g", }, ], }, @@ -489,7 +83,6 @@ export const players = new Map([ ["main", "player_ias.vflset/en_US/base.js"], ["tcc", "player_ias_tcc.vflset/en_US/base.js"], ["tce", "player_ias_tce.vflset/en_US/base.js"], - ["es5", "player_es5.vflset/en_US/base.js"], ["es6", "player_es6.vflset/en_US/base.js"], ["tv", "tv-player-ias.vflset/tv-player-ias.js"], ["tv_es6", "tv-player-es6.vflset/tv-player-es6.js"],