From 0961f9733cd2d74063fdc548a4c3df6b68473335 Mon Sep 17 00:00:00 2001 From: bashonly Date: Fri, 21 Jun 2024 18:47:32 -0500 Subject: [PATCH] [test] Add nsig and jsinterp tests Ref: https://github.com/ytdl-org/youtube-dl/commit/ad01fa6ccadd1ecade8002e937492a141d3b8f25 Authored by: bashonly --- test/test_jsinterp.py | 1 + test/test_youtube_signature.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 86928a6a0..7c556e461 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -92,6 +92,7 @@ def test_operators(self): self._test('function f(){return 0 && 1 || 2;}', 2) self._test('function f(){return 0 ?? 42;}', 0) self._test('function f(){return "life, the universe and everything" < 42;}', False) + self._test('function f(){return 0 - 7 * - 6;}', 42) def test_array_access(self): self._test('function f(){var x = [1,2,3]; x[0] = 4; x[0] = 5; x[2.0] = 7; return x;}', [5, 2, 7]) diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index bfaff83a0..b0f3269e1 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -163,6 +163,10 @@ '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', + ), ]