diff options
author | Remita Amine <remitamine@gmail.com> | 2020-11-16 16:18:37 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2020-11-16 16:18:37 +0100 |
commit | 2ea9c97432a5342f70ed87d440cb1ec97a21cbde (patch) | |
tree | cb9316726e8ffc3015e624044ed4bd808f2abf35 | |
parent | efc589b86578ad98025aa0a9ccfa5db3195c7deb (diff) |
[nbc] fix NBCNews/Today/MSNBC extraction
-rw-r--r-- | youtube_dl/extractor/nbc.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube_dl/extractor/nbc.py b/youtube_dl/extractor/nbc.py index 6f3cb3003..ea5f5a315 100644 --- a/youtube_dl/extractor/nbc.py +++ b/youtube_dl/extractor/nbc.py @@ -10,7 +10,6 @@ from .adobepass import AdobePassIE from ..compat import compat_urllib_parse_unquote from ..utils import ( int_or_none, - js_to_json, parse_duration, smuggle_url, try_get, @@ -394,8 +393,8 @@ class NBCNewsIE(ThePlatformIE): 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'] |