mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-12-17 22:55:42 +07:00
[utils] js_to_json: Make function less fatal (#12715)
Authored by: seproDev
This commit is contained in:
@@ -2767,7 +2767,8 @@ def process_escape(match):
|
||||
def template_substitute(match):
|
||||
evaluated = js_to_json(match.group(1), vars, strict=strict)
|
||||
if evaluated[0] == '"':
|
||||
return json.loads(evaluated)
|
||||
with contextlib.suppress(json.JSONDecodeError):
|
||||
return json.loads(evaluated)
|
||||
return evaluated
|
||||
|
||||
def fix_kv(m):
|
||||
|
||||
Reference in New Issue
Block a user