mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-11 04:54:47 +00:00
[extractor,cleanup] Use _search_nextjs_data
This commit is contained in:
@@ -408,9 +408,7 @@ class NBCNewsIE(ThePlatformIE):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
data = self._parse_json(self._search_regex(
|
||||
r'<script[^>]+id="__NEXT_DATA__"[^>]*>({.+?})</script>',
|
||||
webpage, 'bootstrap json'), video_id)['props']['initialState']
|
||||
data = self._search_nextjs_data(webpage, video_id)['props']['initialState']
|
||||
video_data = try_get(data, lambda x: x['video']['current'], dict)
|
||||
if not video_data:
|
||||
video_data = data['article']['content'][0]['primaryMedia']['video']
|
||||
|
Reference in New Issue
Block a user