Repository: yt-dlp/yt-dlp

Issue:
NBC Sports no longer works
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2021.12.01**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

United States

### Description

It appears the extractor/downloader for NBC Sports videos (e.g. [here](https://www.nbcsports.com/video/mason-mount-nets-emphatic-chelsea-opener-v-liverpool)) is broken. I tried with both the page itself (nbcsports.com/video/....) and the vplayer link which used to work with yt-dlp as well. Neither does anymore.

Clearly the site/player just changed, as yt-dlp used to list the formats as `http-*`, but now the player is playing segmented videos. The videos can still be easily downloaded by snooping for the m3u8 and passing that into yt-dlp, but it would be very useful to allow yt-dlp to download the video just by passing it a link to the whole page, as was the case before.

### Verbose log

```shell
yt-dlp -F https://www.nbcsports.com/video/mason-mount-nets-emphatic-chelsea-opener-v-liverpool -v
[debug] Command-line config: ['-F', 'https://www.nbcsports.com/video/mason-mount-nets-emphatic-chelsea-opener-v-liverpool', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2021.12.01 [91f071af6]
[debug] Python version 3.9.9 (CPython 64bit) - macOS-12.1-arm64-arm-64bit
[debug] exe versions: ffmpeg 4.4.1 (setts), ffprobe 4.4.1
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [NBCSports] Extracting URL: https://www.nbcsports.com/video/mason-mount-nets-emphatic-chelsea-opener-v-liverpool
[NBCSports] mason-mount-nets-emphatic-chelsea-opener-v-liverpool: Downloading webpage
ERROR: 'NoneType' object has no attribute 'startswith'
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1329, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1412, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1442, in process_ie_result
    ie_result['url'] = sanitize_url(ie_result['url'])
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/utils.py", line 2192, in sanitize_url
    if url.startswith('//'):
AttributeError: 'NoneType' object has no attribute 'startswith'



yt-dlp -F vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/w1_FJtEUMaG3 -v
[debug] Command-line config: ['-F', 'vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/w1_FJtEUMaG3', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2021.12.01 [91f071af6]
[debug] Python version 3.9.9 (CPython 64bit) - macOS-12.1-arm64-arm-64bit
[debug] exe versions: ffmpeg 4.4.1 (setts), ffprobe 4.4.1
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [generic] Extracting URL: vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/w1_FJtEUMaG3
WARNING: [generic] The url doesn't specify the protocol, trying with http
[debug] [NBCSportsVPlayer] Extracting URL: http://vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/w1_FJtEUMaG3
[NBCSportsVPlayer] w1_FJtEUMaG3: Downloading webpage
ERROR: [NBCSportsVPlayer] w1_FJtEUMaG3: Unable to extract video url; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 597, in extract
    ie_result = self._real_extract(url)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/nbc.py", line 219, in _real_extract
    theplatform_url = self._og_search_video_url(webpage).replace(
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1285, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1180, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1171, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
yt_dlp.utils.RegexNotFoundError: Unable to extract video url; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 597, in extract
    ie_result = self._real_extract(url)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/nbc.py", line 219, in _real_extract
    theplatform_url = self._og_search_video_url(webpage).replace(
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1285, in _og_search_video_url
    return self._html_search_regex(regexes, html, name, **kargs)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1180, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 1171, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
yt_dlp.utils.RegexNotFoundError: Unable to extract video url; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1329, in wrapper
    return func(self, *args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1398, in __extract_info
    ie_result = ie.extract(url)
  File "/opt/homebrew/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 623, in extract
    raise type(e)(e.msg, **kwargs)
yt_dlp.utils.RegexNotFoundError: [NBCSportsVPlayer] w1_FJtEUMaG3: Unable to extract video url; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/nbc.py b/yt_dlp/extractor/nbc.py
--- a/yt_dlp/extractor/nbc.py
+++ b/yt_dlp/extractor/nbc.py
@@ -197,9 +197,12 @@ class NBCSportsVPlayerIE(InfoExtractor):
             'timestamp': 1426270238,
             'upload_date': '20150313',
             'uploader': 'NBCU-SPORTS',
+            'duration': 72.818,
+            'chapters': [],
+            'thumbnail': r're:^https?://.*\.jpg$'
         }
     }, {
-        'url': 'https://vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/_hqLjQ95yx8Z',
+        'url': 'https://vplayer.nbcsports.com/p/BxmELC/nbcsports_embed/select/media/PEgOtlNcC_y2',
         'only_matching': True,
     }, {
         'url': 'https://www.nbcsports.com/vplayer/p/BxmELC/nbcsports/select/PHJSaFWbrTY9?form=html&autoPlay=true',
@@ -208,16 +211,15 @@ class NBCSportsVPlayerIE(InfoExtractor):
 
     @staticmethod
     def _extract_url(webpage):
-        iframe_m = re.search(
-            r'<(?:iframe[^>]+|div[^>]+data-(?:mpx-)?)src="(?P<url>%s[^"]+)"' % NBCSportsVPlayerIE._VALID_URL_BASE, webpage)
-        if iframe_m:
-            return iframe_m.group('url')
+        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)
-        theplatform_url = self._og_search_video_url(webpage).replace(
-            'vplayer.nbcsports.com', 'player.theplatform.com')
+        theplatform_url = self._html_search_regex(r'tp:releaseUrl="(.+?)"', webpage, 'url')
         return self.url_result(theplatform_url, 'ThePlatform')
 
 
@@ -235,6 +237,9 @@ class NBCSportsIE(InfoExtractor):
             'uploader': 'NBCU-SPORTS',
             'upload_date': '20150330',
             'timestamp': 1427726529,
+            'chapters': [],
+            'thumbnail': 'https://hdliveextra-a.akamaihd.net/HD/image_sports/NBCU_Sports_Group_-_nbcsports/253/303/izzodps.jpg',
+            'duration': 528.395,
         }
     }, {
         # data-mpx-src


Test patch: