1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-25 00:01:47 +00:00

Merge branch 'master' into extract-common-_is_jwt_token_expired-to-InfoExtractor

This commit is contained in:
Michaël De Boey
2025-04-06 09:01:45 +02:00
74 changed files with 2427 additions and 1202 deletions

View File

@@ -2767,7 +2767,8 @@ def js_to_json(code, vars={}, *, strict=False):
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):
@@ -3247,7 +3248,7 @@ def _match_one(filter_part, dct, incomplete):
op = lambda attr, value: not unnegated_op(attr, value)
else:
op = unnegated_op
comparison_value = m['quotedstrval'] or m['strval'] or m['intval']
comparison_value = m['quotedstrval'] or m['strval']
if m['quote']:
comparison_value = comparison_value.replace(r'\{}'.format(m['quote']), m['quote'])
actual_value = dct.get(m['key'])