diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index 2f124a738c..717c949540 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -118,6 +118,10 @@ _NSIG_TESTS = [ 'https://www.youtube.com/s/player/dc0c6770/player_ias.vflset/en_US/base.js', '5EHDMgYLV6HPGk_Mu-kk', 'n9lUJLHbxUI0GQ', ), + ( + 'https://www.youtube.com/s/player/113ca41c/player_ias.vflset/en_US/base.js', + 'cgYl-tlYkhjT7A', 'hI7BBr2zUgcmMg', + ), ] diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index d66732c2fb..b30dadf9f0 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2670,7 +2670,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): def _extract_n_function_code(self, video_id, player_url): player_id = self._extract_player_info(player_url) - func_code = self.cache.load('youtube-nsig', player_id, after='2022.08.19') + func_code = self.cache.load('youtube-nsig', player_id, after='2022.08.19.1') jscode = func_code or self._load_player(video_id, player_url) jsi = JSInterpreter(jscode) diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py index 1995e9d0e1..cadb013a31 100644 --- a/yt_dlp/jsinterp.py +++ b/yt_dlp/jsinterp.py @@ -226,7 +226,7 @@ class JSInterpreter: @staticmethod def _separate(expr, delim=',', max_split=None): - OP_CHARS = '+-*/%&|^=<>!,;' + OP_CHARS = '+-*/%&|^=<>!,;{}()[]:' if not expr: return counters = {k: 0 for k in _MATCHING_PARENS.values()} @@ -243,7 +243,7 @@ class JSInterpreter: elif in_quote == '/' and char in '[]': in_regex_char_group = char == '[' escaping = not escaping and in_quote and char == '\\' - after_op = not in_quote and char in OP_CHARS or (char == ' ' and after_op) + after_op = not in_quote and char in OP_CHARS or (char.isspace() and after_op) if char != delim[pos] or any(counters.values()) or in_quote: pos = 0 diff --git a/yt_dlp/version.py b/yt_dlp/version.py index 1ded15df42..8bfe0a09b4 100644 --- a/yt_dlp/version.py +++ b/yt_dlp/version.py @@ -1,6 +1,6 @@ # Autogenerated by devscripts/update-version.py -__version__ = '2022.08.19.1' +__version__ = '2022.08.19.2' RELEASE_GIT_HEAD = '48c88e088'