aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/nbc.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/nbc.py')
-rw-r--r--yt_dlp/extractor/nbc.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/yt_dlp/extractor/nbc.py b/yt_dlp/extractor/nbc.py
index 365c2e60d..910cbedf6 100644
--- a/yt_dlp/extractor/nbc.py
+++ b/yt_dlp/extractor/nbc.py
@@ -184,6 +184,7 @@ class NBCIE(ThePlatformIE):
class NBCSportsVPlayerIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:vplayer\.nbcsports\.com|(?:www\.)?nbcsports\.com/vplayer)/'
_VALID_URL = _VALID_URL_BASE + r'(?:[^/]+/)+(?P<id>[0-9a-zA-Z_]+)'
+ _EMBED_REGEX = [r'(?:iframe[^>]+|var video|div[^>]+data-(?:mpx-)?)[sS]rc\s?=\s?"(?P<url>%s[^\"]+)' % _VALID_URL_BASE]
_TESTS = [{
'url': 'https://vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/9CsDKds0kvHI',
@@ -207,13 +208,6 @@ class NBCSportsVPlayerIE(InfoExtractor):
'only_matching': True,
}]
- @staticmethod
- def _extract_url(webpage):
- video_urls = re.search(
- r'(?:iframe[^>]+|var video|div[^>]+data-(?:mpx-)?)[sS]rc\s?=\s?"(?P<url>%s[^\"]+)' % NBCSportsVPlayerIE._VALID_URL_BASE, webpage)
- if video_urls:
- return video_urls.group('url')
-
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
@@ -317,6 +311,7 @@ class NBCSportsStreamIE(AdobePassIE):
class NBCNewsIE(ThePlatformIE):
_VALID_URL = r'(?x)https?://(?:www\.)?(?:nbcnews|today|msnbc)\.com/([^/]+/)*(?:.*-)?(?P<id>[^/?]+)'
+ _EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//www\.nbcnews\.com/widget/video-embed/[^"\']+)\1']
_TESTS = [
{