mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-03 20:42:49 -05:00
[utils:js_to_json] Fix bad escape in double quoted strings
This commit is contained in:
@ -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: {
|
||||
'\\\\': '\\\\',
|
||||
|
Reference in New Issue
Block a user