mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-10 10:49:45 +00:00
Authored by: ChillingPepper, pukkandan
This commit is contained in:
@@ -3360,7 +3360,13 @@ def js_to_json(code, vars={}, *, strict=False):
|
||||
return f'"{i}":' if v.endswith(':') else str(i)
|
||||
|
||||
if v in vars:
|
||||
return json.dumps(vars[v])
|
||||
try:
|
||||
if not strict:
|
||||
json.loads(vars[v])
|
||||
except json.decoder.JSONDecodeError:
|
||||
return json.dumps(vars[v])
|
||||
else:
|
||||
return vars[v]
|
||||
|
||||
if not strict:
|
||||
return f'"{v}"'
|
||||
|
Reference in New Issue
Block a user