mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-03 08:35:32 +00:00
[extractor,cleanup] Use _search_nextjs_data
This commit is contained in:
@ -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'])
|
||||
|
Reference in New Issue
Block a user