From d6ba53417a141c0ab05039be3d7597f57c9a232b Mon Sep 17 00:00:00 2001 From: sulyi Date: Mon, 21 Nov 2016 07:18:33 +0100 Subject: [PATCH 1/2] [utils] Fixing js_to_json * or / in comment --- 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 877879446..3a14048c9 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2115,7 +2115,7 @@ def js_to_json(code): return re.sub(r'''(?sx) "(?:[^"\\]*(?:\\\\|\\['"nurtbfx/\n]))*[^"\\]*"| '(?:[^'\\]*(?:\\\\|\\['"nurtbfx/\n]))*[^'\\]*'| - /\*[^*]*\*/|,(?=(\s|(/\*[^*]*\*/))*[\]}])| + /\*((?!\*/)\n|.)*\*/|,(?=(\s|(/\*((?!\*/)\n|.)*\*/))*[\]}])| [a-zA-Z_][.a-zA-Z_0-9]*| \b(?:0[xX][0-9a-fA-F]+|0+[0-7]+)(?:\s*:)?| [0-9]+(?=\s*:) From d13093bed37a17e96225eb587deacf3cd370f328 Mon Sep 17 00:00:00 2001 From: sulyi Date: Mon, 21 Nov 2016 07:23:22 +0100 Subject: [PATCH 2/2] [utils] Rebalance of pattern in js_to_json --- youtube_dl/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 3a14048c9..bda59e627 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2115,8 +2115,8 @@ def js_to_json(code): return re.sub(r'''(?sx) "(?:[^"\\]*(?:\\\\|\\['"nurtbfx/\n]))*[^"\\]*"| '(?:[^'\\]*(?:\\\\|\\['"nurtbfx/\n]))*[^'\\]*'| - /\*((?!\*/)\n|.)*\*/|,(?=(\s|(/\*((?!\*/)\n|.)*\*/))*[\]}])| - [a-zA-Z_][.a-zA-Z_0-9]*| + ,(?=(\s|(/\*((?!\*/)\n|.)*\*/))*[\]}])| + /\*((?!\*/)\n|.)*\*/|[a-zA-Z_][.a-zA-Z_0-9]*| \b(?:0[xX][0-9a-fA-F]+|0+[0-7]+)(?:\s*:)?| [0-9]+(?=\s*:) ''', fix_kv, code)