aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/jsinterp.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-08-30 15:57:17 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-08-30 16:06:40 +0530
commitc4b2df872d0ab49da939bf8bda001fa4e2d2ea06 (patch)
tree9e69eaaa395a8ee459a2a9ed6980fc09db11c353 /yt_dlp/jsinterp.py
parent224b5a35f7f17fec5639608d31074b8048369385 (diff)
downloadhypervideo-pre-c4b2df872d0ab49da939bf8bda001fa4e2d2ea06.tar.lz
hypervideo-pre-c4b2df872d0ab49da939bf8bda001fa4e2d2ea06.tar.xz
hypervideo-pre-c4b2df872d0ab49da939bf8bda001fa4e2d2ea06.zip
[jsinterp] Fix `_separate`
Ref: https://github.com/yt-dlp/yt-dlp/issues/4635#issuecomment-1231126941
Diffstat (limited to 'yt_dlp/jsinterp.py')
-rw-r--r--yt_dlp/jsinterp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py
index 1995e9d0e..cadb013a3 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