From 9b868518a15599f3d7ef5a1c730dda164c30da9b Mon Sep 17 00:00:00 2001 From: sepro Date: Fri, 21 Mar 2025 21:58:10 +0100 Subject: [ie/youtube] Fix nsig and signature extraction for player `643afba4` (#12684) Closes #12677, Closes #12682 Authored by: seproDev, bashonly Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com> --- test/test_jsinterp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/test_jsinterp.py') diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index ed3ca61c4..055dcf42f 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -462,6 +462,16 @@ class TestJSInterpreter(unittest.TestCase): ]: assert js_number_to_string(test, radix) == expected + def test_extract_function(self): + jsi = JSInterpreter('function a(b) { return b + 1; }') + func = jsi.extract_function('a') + self.assertEqual(func([2]), 3) + + def test_extract_function_with_global_stack(self): + jsi = JSInterpreter('function c(d) { return d + e + f + g; }') + func = jsi.extract_function('c', {'e': 10}, {'f': 100, 'g': 1000}) + self.assertEqual(func([1]), 1111) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3