diff options
author | dirkf <fieldhouse@gmx.net> | 2024-06-19 21:44:27 +0100 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2024-06-20 20:03:49 +0100 |
commit | ad01fa6ccadd1ecade8002e937492a141d3b8f25 (patch) | |
tree | 11ba00027ff2204d07da12acd7d202a6002e2fd6 /test | |
parent | 2eac0fa3799b3d027148341186a52fb5a6288473 (diff) |
[jsinterp] Add Debugger from yt-dlp
* https://github.com/yt-dlp/yt-dlp/commit/8f53dc4
* thx pukkandan
Diffstat (limited to 'test')
-rw-r--r-- | test/test_jsinterp.py | 8 | ||||
-rw-r--r-- | test/test_youtube_signature.py | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 91b12f544..da8e98020 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -577,9 +577,11 @@ class TestJSInterpreter(unittest.TestCase): def test_unary_operators(self): jsi = JSInterpreter('function f(){return 2 - - - 2;}') self.assertEqual(jsi.call_function('f'), 0) - # fails - # jsi = JSInterpreter('function f(){return 2 + - + - - 2;}') - # self.assertEqual(jsi.call_function('f'), 0) + jsi = JSInterpreter('function f(){return 2 + - + - - 2;}') + self.assertEqual(jsi.call_function('f'), 0) + # https://github.com/ytdl-org/youtube-dl/issues/32815 + jsi = JSInterpreter('function f(){return 0 - 7 * - 6;}') + self.assertEqual(jsi.call_function('f'), 42) """ # fails so far def test_packed(self): diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index f45dfec7c..cafba7a5c 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -158,6 +158,10 @@ _NSIG_TESTS = [ 'https://www.youtube.com/s/player/b7910ca8/player_ias.vflset/en_US/base.js', '_hXMCwMt9qE310D', 'LoZMgkkofRMCZQ', ), + ( + 'https://www.youtube.com/s/player/590f65a6/player_ias.vflset/en_US/base.js', + '1tm7-g_A9zsI8_Lay_', 'xI4Vem4Put_rOg', + ), ] |