mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-06 06:45:00 +01:00
[jsinterp] Fix extract_object (#13580)
Fixes sig extraction for YouTube player `e12fbea4` Authored by: seproDev
This commit is contained in:
parent
1b88384634
commit
958153a226
3 changed files with 10 additions and 1 deletions
|
|
@ -478,6 +478,10 @@ class TestJSInterpreter(unittest.TestCase):
|
|||
func = jsi.extract_function('c', {'e': 10}, {'f': 100, 'g': 1000})
|
||||
self.assertEqual(func([1]), 1111)
|
||||
|
||||
def test_extract_object(self):
|
||||
jsi = JSInterpreter('var a={};a.xy={};var xy;var zxy={};xy={z:function(){return "abc"}};')
|
||||
self.assertTrue('z' in jsi.extract_object('xy', None))
|
||||
|
||||
def test_increment_decrement(self):
|
||||
self._test('function f() { var x = 1; return ++x; }', 2)
|
||||
self._test('function f() { var x = 1; return x++; }', 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue