diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-05-24 23:05:20 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2023-05-24 23:30:45 +0530 |
commit | 7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8 (patch) | |
tree | 995084225bf8717c8adb9a1f7512a62f7cc7339d /yt_dlp/jsinterp.py | |
parent | 15b2d3db1d40b0437fca79d8874d392aa54b3cdd (diff) | |
download | hypervideo-pre-7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8.tar.lz hypervideo-pre-7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8.tar.xz hypervideo-pre-7aeda6cc9e73ada0b0a0b6a6748c66bef63a20a8.zip |
[jsinterp] Do not compile regex
Diffstat (limited to 'yt_dlp/jsinterp.py')
-rw-r--r-- | yt_dlp/jsinterp.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py index 1ef1f0823..7c7940efd 100644 --- a/yt_dlp/jsinterp.py +++ b/yt_dlp/jsinterp.py @@ -352,8 +352,10 @@ class JSInterpreter: inner, outer = self._separate(expr, expr[0], 1) if expr[0] == '/': flags, outer = self._regex_flags(outer) + # We don't support regex methods yet, so no point compiling it + inner = f'{inner}/{flags}' # Avoid https://github.com/python/cpython/issues/74534 - inner = re.compile(inner[1:].replace('[[', r'[\['), flags=flags) + # inner = re.compile(inner[1:].replace('[[', r'[\['), flags=flags) else: inner = json.loads(js_to_json(f'{inner}{expr[0]}', strict=True)) if not outer: |