aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp
diff options
context:
space:
mode:
authorfelix <felix.von.s@posteo.de>2021-07-13 09:18:20 +0200
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-07-14 05:02:43 +0530
commitc843e685884ccc1a5186693d6450a34232b4377d (patch)
tree9d37f00402a8843158b0727b4a490a68b3717585 /yt_dlp
parent198f7ea89e89f0b3bc1f890cd4e5b98006fe9fa2 (diff)
downloadhypervideo-pre-c843e685884ccc1a5186693d6450a34232b4377d.tar.lz
hypervideo-pre-c843e685884ccc1a5186693d6450a34232b4377d.tar.xz
hypervideo-pre-c843e685884ccc1a5186693d6450a34232b4377d.zip
[utils] Improve `js_to_json` comment regex
Capture the newline character as part of a single-line comment From #497, Authored by: fstirlitz
Diffstat (limited to 'yt_dlp')
-rw-r--r--yt_dlp/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 8f9cb46f6..795c5632f 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -4365,7 +4365,7 @@ def strip_jsonp(code):
def js_to_json(code, vars={}):
# vars is a dict of var, val pairs to substitute
- COMMENT_RE = r'/\*(?:(?!\*/).)*?\*/|//[^\n]*'
+ COMMENT_RE = r'/\*(?:(?!\*/).)*?\*/|//[^\n]*\n'
SKIP_RE = r'\s*(?:{comment})?\s*'.format(comment=COMMENT_RE)
INTEGER_TABLE = (
(r'(?s)^(0[xX][0-9a-fA-F]+){skip}:?$'.format(skip=SKIP_RE), 16),