aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-10-20 23:09:51 +0600
committerSergey M․ <dstftw@gmail.com>2015-10-20 23:09:51 +0600
commitd01949dc89feb2441f251e42e8a6bfa4711b9715 (patch)
tree5c7e6ae1a1a5f89670118cbf734487b2c46f8047 /youtube_dl
parent63a64948342ebfe46db8c258765e698a04a61904 (diff)
downloadyoutube-dl-d01949dc89feb2441f251e42e8a6bfa4711b9715.tar.xz
[utils:js_to_json] Fix bad escape in double quoted strings
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index db5b3698e..a61e47646 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1701,8 +1701,8 @@ def js_to_json(code):
if v in ('true', 'false', 'null'):
return v
if v.startswith('"'):
- return v
- if v.startswith("'"):
+ v = re.sub(r"\\'", "'", v[1:-1])
+ elif v.startswith("'"):
v = v[1:-1]
v = re.sub(r"\\\\|\\'|\"", lambda m: {
'\\\\': '\\\\',