diff options
author | bashonly <bashonly@bashonly.com> | 2023-09-16 13:28:14 -0500 |
---|---|---|
committer | bashonly <bashonly@bashonly.com> | 2023-09-16 13:28:14 -0500 |
commit | 069cbece9dba6384f1cc5fcfc7ce562a31af42fc (patch) | |
tree | c39f34348b8a288509620b56dd3d10bbaadb05d3 | |
parent | f659e6439444ac64305b5c80688cd82f59d2279c (diff) |
[ie/tiktok] Fix webpage extraction
Closes #8089
Authored by: bashonly
-rw-r--r-- | yt_dlp/extractor/tiktok.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yt_dlp/extractor/tiktok.py b/yt_dlp/extractor/tiktok.py index f14c4f9d6..f26972cff 100644 --- a/yt_dlp/extractor/tiktok.py +++ b/yt_dlp/extractor/tiktok.py @@ -15,7 +15,6 @@ from ..utils import ( UserNotLive, determine_ext, format_field, - get_element_by_id, get_first, int_or_none, join_nonempty, @@ -50,8 +49,9 @@ class TikTokBaseIE(InfoExtractor): return f'https://www.tiktok.com/@{user_id or "_"}/video/{video_id}' def _get_sigi_state(self, webpage, display_id): - return self._parse_json(get_element_by_id( - 'SIGI_STATE|sigi-persisted-data', webpage, escape_value=False), display_id) + return self._search_json( + r'<script[^>]+\bid="(?:SIGI_STATE|sigi-persisted-data)"[^>]*>', webpage, + 'sigi state', display_id, end_pattern=r'</script>') def _call_api_impl(self, ep, query, manifest_app_version, video_id, fatal=True, note='Downloading API JSON', errnote='Unable to download API page'): |