mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-06 06:45:00 +01:00
[extractor,cleanup] Use _search_nextjs_data
This commit is contained in:
parent
e0585e6562
commit
135dfa2c7e
8 changed files with 12 additions and 26 deletions
|
|
@ -34,8 +34,7 @@ class TelemundoIE(InfoExtractor):
|
|||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
metadata = self._parse_json(
|
||||
self._search_regex(r'<[^>]+id="__NEXT_DATA__"[^>]+>([^<]+)', webpage, 'JSON metadata'), video_id)
|
||||
metadata = self._search_nextjs_data(webpage, video_id)
|
||||
redirect_url = try_get(
|
||||
metadata,
|
||||
lambda x: x['props']['initialState']['video']['associatedPlaylists'][0]['videos'][0]['videoAssets'][0]['publicUrl'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue