From 164b03c4864b0d44cfee5e7702f7c2317164a6cf Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 25 Aug 2022 09:36:32 +0530 Subject: [PATCH] [jsinterp] Fix bug in operator precedence Fixes https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1226659543 --- test/test_youtube_signature.py | 4 ++++ yt_dlp/jsinterp.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index 4b526ff2e2..2f124a738c 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -114,6 +114,10 @@ 'https://www.youtube.com/s/player/009f1d77/player_ias.vflset/en_US/base.js', '5dwFHw8aFWQUQtffRq', 'audescmLUzI3jw', ), + ( + 'https://www.youtube.com/s/player/dc0c6770/player_ias.vflset/en_US/base.js', + '5EHDMgYLV6HPGk_Mu-kk', 'n9lUJLHbxUI0GQ', + ), ] diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py index 2b68f53fae..1995e9d0e1 100644 --- a/yt_dlp/jsinterp.py +++ b/yt_dlp/jsinterp.py @@ -98,8 +98,8 @@ def _js_ternary(cndn, if_true=True, if_false=False): '&': _js_bit_op(operator.and_), '===': operator.is_, - '==': _js_eq_op(operator.eq), '!==': operator.is_not, + '==': _js_eq_op(operator.eq), '!=': _js_eq_op(operator.ne), '<=': _js_comp_op(operator.le),