1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-19 05:11:29 +00:00

[utils] js_to_json: Prevent false positives for octals (#15474)

Authored by: doe1080
This commit is contained in:
doe1080
2026-01-04 05:53:16 +09:00
committed by GitHub
parent 0066de5b7e
commit 4d4c7e1c69
2 changed files with 4 additions and 1 deletions

View File

@@ -2830,7 +2830,7 @@ def js_to_json(code, vars={}, *, strict=False):
{STRING_RE}|
{COMMENT_RE}|,(?={SKIP_RE}[\]}}])|
void\s0|(?:(?<![0-9])[eE]|[a-df-zA-DF-Z_$])[.a-zA-Z_$0-9]*|
\b(?:0[xX][0-9a-fA-F]+|0+[0-7]+)(?:{SKIP_RE}:)?|
\b(?:0[xX][0-9a-fA-F]+|(?<!\.)0+[0-7]+)(?:{SKIP_RE}:)?|
[0-9]+(?={SKIP_RE}:)|
!+
''', fix_kv, code)