Skip to content

Commit

Permalink
[nbc] fix NBCNews/Today/MSNBC extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine committed Nov 16, 2020
1 parent efc589b commit 2ea9c97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions youtube_dl/extractor/nbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ..compat import compat_urllib_parse_unquote
from ..utils import (
int_or_none,
js_to_json,
parse_duration,
smuggle_url,
try_get,
Expand Down Expand Up @@ -394,8 +393,8 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, video_id)

data = self._parse_json(self._search_regex(
r'window\.__data\s*=\s*({.+});', webpage,
'bootstrap json'), video_id, js_to_json)
r'<script[^>]+id="__NEXT_DATA__"[^>]*>({.+?})</script>',
webpage, 'bootstrap json'), 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']
Expand Down

0 comments on commit 2ea9c97

Please sign in to comment.