[extractor/txxx] Add extractors (#5240)

Authored by: chio0hai
Closes #5021
This commit is contained in:
chio0hai
2023-02-03 13:47:00 -05:00
committed by GitHub
parent b032ff0f03
commit 389896df85
4 changed files with 424 additions and 14 deletions

View File

@@ -3385,6 +3385,8 @@ def js_to_json(code, vars={}, *, strict=False):
if not strict:
code = re.sub(r'new Date\((".+")\)', r'\g<1>', code)
code = re.sub(r'new \w+\((.*?)\)', lambda m: json.dumps(m.group(0)), code)
code = re.sub(r'parseInt\([^\d]+(\d+)[^\d]+\)', r'\1', code)
code = re.sub(r'\(function\([^)]*\)\s*\{[^}]*\}\s*\)\s*\(\s*(["\'][^)]*["\'])\s*\)', r'\1', code)
return re.sub(rf'''(?sx)
{STRING_RE}|