diff options
author | chio0hai <94094996+chio0hai@users.noreply.github.com> | 2023-02-03 13:47:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 00:17:00 +0530 |
commit | 389896df85ed14eaf74f72531da6c4491d6b73b0 (patch) | |
tree | 0df470b7b1339e9b0172ad1684221f0601f9f2ac /yt_dlp/utils.py | |
parent | b032ff0f032512bd6fc70c9c1994d906eacc06cb (diff) | |
download | hypervideo-pre-389896df85ed14eaf74f72531da6c4491d6b73b0.tar.lz hypervideo-pre-389896df85ed14eaf74f72531da6c4491d6b73b0.tar.xz hypervideo-pre-389896df85ed14eaf74f72531da6c4491d6b73b0.zip |
[extractor/txxx] Add extractors (#5240)
Authored by: chio0hai
Closes #5021
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 55e1c4415..e1e0f7b25 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -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}| |