Repository: yt-dlp/yt-dlp

Issue:
Winsports.co now throws unsupported url error
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2023.02.17** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#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 [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and 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

Colombia

### Provide a description that is worded well enough to be understood

yt-dlp now throws unsupported url error for winsport.co

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', 'https://www.winsports.co/videos/equidad-vuelve-defender-su-arco-de-remates-de-junior']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.02.17 [a0a7c01] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg N-109920-gac6eec1fc2-20230224 (setts), ffprobe N-109920-gac6eec1fc2-20230224
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1782 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.02.17, Current version: 2023.02.17
yt-dlp is up to date (2023.02.17)
[generic] Extracting URL: https://www.winsports.co/videos/equidad-vuelve-defender-su-arco-de-remates-de-junior
[generic] equidad-vuelve-defender-su-arco-de-remates-de-junior: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] equidad-vuelve-defender-su-arco-de-remates-de-junior: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://www.winsports.co/videos/equidad-vuelve-defender-su-arco-de-remates-de-junior
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1502, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1578, in __extract_info
  File "yt_dlp\extractor\common.py", line 693, in extract
  File "yt_dlp\extractor\generic.py", line 2509, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.winsports.co/videos/equidad-vuelve-defender-su-arco-de-remates-de-junior
```



Discussion:
Looks like the site doesn't always use numeric IDs in the URLs anymore. This should fix it:

```diff
diff --git a/yt_dlp/extractor/mediastream.py b/yt_dlp/extractor/mediastream.py
index 4d3949527..efb6ee701 100644
--- a/yt_dlp/extractor/mediastream.py
+++ b/yt_dlp/extractor/mediastream.py
@@ -1,7 +1,13 @@
 import re
 
 from .common import InfoExtractor
-from ..utils import clean_html, get_element_html_by_class
+from ..utils import (
+    clean_html,
+    get_element_html_by_class,
+    str_or_none,
+    traverse_obj,
+    urljoin,
+)
 
 
 class MediaStreamIE(InfoExtractor):
@@ -117,7 +123,7 @@ def _real_extract(self, url):
 
 
 class WinSportsVideoIE(InfoExtractor):
-    _VALID_URL = r'https?://www\.winsports\.co/videos/(?P<display_id>[\w-]+)-(?P<id>\d+)'
+    _VALID_URL = r'https?://www\.winsports\.co/videos/(?P<id>[\w-]+)'
 
     _TESTS = [{
         'url': 'https://www.winsports.co/videos/siempre-castellanos-gran-atajada-del-portero-cardenal-para-evitar-la-caida-de-su-arco-60536',
@@ -142,14 +148,17 @@ class WinSportsVideoIE(InfoExtractor):
     }]
 
     def _real_extract(self, url):
-        display_id, video_id = self._match_valid_url(url).group('display_id', 'id')
+        display_id = self._match_id(url)
         webpage = self._download_webpage(url, display_id)
 
         media_setting_json = self._search_json(
             r'<script\s*[^>]+data-drupal-selector="drupal-settings-json">', webpage, 'drupal-setting-json', display_id)
 
-        mediastream_id = media_setting_json['settings']['mediastream_formatter'][video_id]['mediastream_id']
+        mediastream_id = traverse_obj(
+            media_setting_json, ('settings', 'mediastream_formatter', ..., 'mediastream_id', {str_or_none}), get_all=False)
+        if not mediastream_id:
+            self.raise_no_formats('No MediaStream embed found in webpage')
 
         return self.url_result(
-            f'https://mdstrm.com/embed/{mediastream_id}', MediaStreamIE, video_id, url_transparent=True,
+            urljoin('https://mdstrm.com/embed/', mediastream_id), MediaStreamIE, display_id, url_transparent=True,
             display_id=display_id, video_title=clean_html(get_element_html_by_class('title-news', webpage)))
```

`urljoin` is necessary because it looks like the value of `mediastream_id` in the JSON can also be the full URL instead of just the ID:
```json
"mediastream_formatter": {
  "74338": {
    "autoplay": "1",
    "view_mode": "default",
    "mediastream_id": "https://mdstrm.com/embed/63fa7eca72f1741ad3a4d515",
    "node_id": "74338"
  }
}
```

Resolving patch:
diff --git a/yt_dlp/extractor/mediastream.py b/yt_dlp/extractor/mediastream.py
--- a/yt_dlp/extractor/mediastream.py
+++ b/yt_dlp/extractor/mediastream.py
@@ -1,7 +1,13 @@
 import re
 
 from .common import InfoExtractor
-from ..utils import clean_html, get_element_html_by_class
+from ..utils import (
+    remove_end,
+    str_or_none,
+    strip_or_none,
+    traverse_obj,
+    urljoin,
+)
 
 
 class MediaStreamIE(InfoExtractor):
@@ -117,39 +123,56 @@ def _real_extract(self, url):
 
 
 class WinSportsVideoIE(InfoExtractor):
-    _VALID_URL = r'https?://www\.winsports\.co/videos/(?P<display_id>[\w-]+)-(?P<id>\d+)'
+    _VALID_URL = r'https?://www\.winsports\.co/videos/(?P<id>[\w-]+)'
 
     _TESTS = [{
         'url': 'https://www.winsports.co/videos/siempre-castellanos-gran-atajada-del-portero-cardenal-para-evitar-la-caida-de-su-arco-60536',
         'info_dict': {
             'id': '62dc8357162c4b0821fcfb3c',
-            'display_id': 'siempre-castellanos-gran-atajada-del-portero-cardenal-para-evitar-la-caida-de-su-arco',
+            'display_id': 'siempre-castellanos-gran-atajada-del-portero-cardenal-para-evitar-la-caida-de-su-arco-60536',
             'title': '¡Siempre Castellanos! Gran atajada del portero \'cardenal\' para evitar la caída de su arco',
             'description': 'md5:eb811b2b2882bdc59431732c06b905f2',
             'thumbnail': r're:^https?://[^?#]+62dc8357162c4b0821fcfb3c',
             'ext': 'mp4',
         },
+        'params': {'skip_download': 'm3u8'},
     }, {
         'url': 'https://www.winsports.co/videos/observa-aqui-los-goles-del-empate-entre-tolima-y-nacional-60548',
         'info_dict': {
             'id': '62dcb875ef12a5526790b552',
-            'display_id': 'observa-aqui-los-goles-del-empate-entre-tolima-y-nacional',
+            'display_id': 'observa-aqui-los-goles-del-empate-entre-tolima-y-nacional-60548',
             'title': 'Observa aquí los goles del empate entre Tolima y Nacional',
             'description': 'md5:b19402ba6e46558b93fd24b873eea9c9',
             'thumbnail': r're:^https?://[^?#]+62dcb875ef12a5526790b552',
             'ext': 'mp4',
         },
+        'params': {'skip_download': 'm3u8'},
+    }, {
+        'url': 'https://www.winsports.co/videos/equidad-vuelve-defender-su-arco-de-remates-de-junior',
+        'info_dict': {
+            'id': '63fa7eca72f1741ad3a4d515',
+            'display_id': 'equidad-vuelve-defender-su-arco-de-remates-de-junior',
+            'title': '⚽ Equidad vuelve a defender su arco de remates de Junior',
+            'description': 'Remate de Sierra',
+            'thumbnail': r're:^https?://[^?#]+63fa7eca72f1741ad3a4d515',
+            'ext': 'mp4',
+        },
+        'params': {'skip_download': 'm3u8'},
     }]
 
     def _real_extract(self, url):
-        display_id, video_id = self._match_valid_url(url).group('display_id', 'id')
+        display_id = self._match_id(url)
         webpage = self._download_webpage(url, display_id)
-
+        json_ld = self._search_json_ld(webpage, display_id, expected_type='VideoObject', default={})
         media_setting_json = self._search_json(
             r'<script\s*[^>]+data-drupal-selector="drupal-settings-json">', webpage, 'drupal-setting-json', display_id)
 
-        mediastream_id = media_setting_json['settings']['mediastream_formatter'][video_id]['mediastream_id']
+        mediastream_id = traverse_obj(
+            media_setting_json, ('settings', 'mediastream_formatter', ..., 'mediastream_id', {str_or_none}),
+            get_all=False) or json_ld.get('url')
+        if not mediastream_id:
+            self.raise_no_formats('No MediaStream embed found in webpage')
 
         return self.url_result(
-            f'https://mdstrm.com/embed/{mediastream_id}', MediaStreamIE, video_id, url_transparent=True,
-            display_id=display_id, video_title=clean_html(get_element_html_by_class('title-news', webpage)))
+            urljoin('https://mdstrm.com/embed/', mediastream_id), MediaStreamIE, display_id, url_transparent=True,
+            display_id=display_id, video_title=strip_or_none(remove_end(json_ld.get('title'), '| Win Sports')))


Test patch: