From 3acb64abd5bc83c0a1aac120415c24820c471655 Mon Sep 17 00:00:00 2001 From: TinyToweringTree <54483833+TinyToweringTree@users.noreply.github.com> Date: Wed, 29 Jan 2020 08:47:05 +0100 Subject: [PATCH] [utils] Fix comment handling in js_to_json for Python <3.5 --- youtube_dl/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 2ff23d231..bfd260a47 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -3984,7 +3984,7 @@ def js_to_json(code): # This regular expression is based on this Stack Overflow answer: # https://stackoverflow.com/a/25735600 code = re.sub(r'("(?:[^"\\]|\\[\s\S])*"|\'(?:[^\'\\]|\\[\s\S])*\')|[ \t]*//.*|[ \t]*/\*(?:[^*]|\*(?!/))*\*/', - '\\1', code) + lambda m: m.group(1) or '', code) def fix_kv(m): v = m.group(0)