[jsinterp] Workaround operator associativity issue
authorpukkandan <pukkandan.ytdlp@gmail.com>
Fri, 2 Sep 2022 15:11:39 +0000 (20:41 +0530)
committerdirkf <fieldhouse@gmx.net>
Fri, 2 Sep 2022 23:53:56 +0000 (00:53 +0100)
* temporary fix for player 5a3b6271 [1]

1. https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1235384480

test/test_youtube_signature.py
youtube_dl/jsinterp.py

index ec914a8713313a3aa2ef7ec1dd377977159c16a1..4e678cae00de2efce816e382566405f882f96a2a 100644 (file)
@@ -131,6 +131,10 @@ _NSIG_TESTS = [
         'https://www.youtube.com/s/player/c57c113c/player_ias.vflset/en_US/base.js',
         '-Txvy6bT5R6LqgnQNx', 'dcklJCnRUHbgSg',
     ),
+    (
+        'https://www.youtube.com/s/player/5a3b6271/player_ias.vflset/en_US/base.js',
+        'B2j7f_UPT4rfje85Lu_e', 'm5DmNymaGQ5RdQ',
+    ),
 ]
 
 
index d13329396f5be7b297c309ea599d7191bb6dad8e..99dd9843549244d2d4effd034865f54ec5ffff74 100644 (file)
@@ -107,8 +107,8 @@ _OPERATORS = (
     ('+', _js_arith_op(operator.add)),
     ('-', _js_arith_op(operator.sub)),
     ('*', _js_arith_op(operator.mul)),
-    ('/', _js_div),
     ('%', _js_mod),
+    ('/', _js_div),
     ('**', _js_exp),
 )