Repository: yt-dlp/yt-dlp

Issue:
Bundesliga  / Fußball-Bundesliga
### Checklist

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running yt-dlp version **2021.12.27**. ([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 none of provided URLs [violate any copyrights](https://github.com/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [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 am willing to share it if required

### Region

Canada

### Example URLs

https://www.bundesliga.com/en/bundesliga/videos?vid=kKqOWhke
https://www.bundesliga.com/en/bundesliga/videos?vid=7Y4djqmo



These are videos from the Club sites.... these fail differently, so maybe yet a different extractor?

https://fcbayern.com/fcbayerntv/en/videos/2022/01/julian-nagelsmann-s-pre-koln-press-conference

https://sgf1903.de/de/kleeblatt-tv/detailseite/leitl-wirklich-couragiert-extrem-diszipliniert-pk-nach-bvbsgf-1318?tagList=7,284,321,754,446,705,408,405,671

https://www.vfl-bochum.de/en/home/#video-slider-widget-23

https://www.fc-tv.de/?vid=8L3EvqIW

https://tv.herthabsc.com/detail/list/49?videoId=1162

https://www.fcaugsburg.de/article/maier-muessen-an-unsere-grenzen-gehen-15108

https://www.tsg-hoffenheim.de/aktuelles/news/2022/01/hoeness-union-spielt-sehr-diszipliniert/

https://www.scfreiburg.com/de/aktuell/sc-freiburg-tv/alle-videos/detailseite/pk-nach-heimsieg-gegen-dortmund-4088?tagList=238,856,32

https://vfbtv.vfb.de/tv/video/interviews/pressekonferenzen-2021-2022/20220113_VfB-PK_vor_RBLeipzig/

https://tv.eintracht.de/video/wer-verliert-muss-zum-arschbolzen-i-trainingsbericht-138602










### Description

[The Bundesliga is a professional association football league in Germany. At the top of the German football league system, the Bundesliga is Germany's primary football competition. ](https://en.wikipedia.org/wiki/Bundesliga)

When yt-dlp downloads a  Budesliga video the result is a HTML  file  (ie: videos [videosvid=9iAI4bBa].unknown_video)


The Bundesliga club sites all fail with an "Unsupported URL" error...so that may be yet another extractor?  
Please let me know if I should open another thread.



Thanks Ringo...

### Verbose log

```shell
>yt-dlp.py -v "https://www.bundesliga.com/en/bundesliga/videos?vid=7Y4djqmo"
[debug] Command-line config: ['-v', 'https://www.bundesliga.com/en/bundesliga/videos?vid=7Y4djqmo']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2021.12.27 [6223f67a8] (zip)
[debug] Python version 3.6.6 (CPython 64bit) - Windows-10-10.0.14393-SP0
[debug] exe versions: ffmpeg 4.3.2-2021-02-02-full_build-www.gyan.dev, ffprobe 4.3.2-2021-02-02-full_build-www.gyan.dev, rtmpdump 2.4
[debug] Optional libraries: sqlite
[debug] Proxy map: {}
[debug] [generic] Extracting URL: https://www.bundesliga.com/en/bundesliga/videos?vid=7Y4djqmo
[generic] videos?vid=7Y4djqmo: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] videos?vid=7Y4djqmo: Downloading webpage
WARNING: [generic] URL could be a direct video link, returning it as such.
[debug] Default format spec: bestvideo*+bestaudio/best
[info] videos?vid=7Y4djqmo: Downloading 1 format(s): 0
[debug] Invoking downloader on "https://www.bundesliga.com/en/bundesliga/videos?vid=7Y4djqmo"
[download] videos [videosvid=7Y4djqmo].unknown_video has already been downloaded
[download] 100% of 475.45KiB
```



Discussion:
To devs:
The original site is a json mess. 
But doing `https://cdn.jwplayer.com/manifests/<id>.m3u8` and `https://cdn.jwplayer.com/manifests/<id>.mpd` will give you the formats.
Good luck parsing all the other details from the json tho.
(This is just for the original league site and not the clubs)
> To devs: The original site is a json mess. But doing `https://cdn.jwplayer.com/manifests/<id>.m3u8` and `https://cdn.jwplayer.com/manifests/<id>.mpd` will give you the formats. Good luck parsing all the other details from the json tho. (This is just for the original league site and not the clubs)

To add to this, for www.bundesliga.com single video:

The JWPlatform extractor can handle this video, and extracts some metadata. So if that's enough then the extractor can just be a url result pointing to JWPlatformIE (i.e. `jwplatform:<id>` where id is the `vid` ie in the bundesliga url).

If you want to parse the json, the `&q;` needs to be replaced with `"`. However I don't think this includes any useful data.

> These are videos from the Club sites.... these fail differently, so maybe yet a different extractor?

All these other sites should be opened as separate site requests, unless the underlying extraction is the same (which I don't think that's the case). 

This issue can be assumed to be only for www.bundesliga.com.



Resolving patch:
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py
--- a/yt_dlp/extractor/_extractors.py
+++ b/yt_dlp/extractor/_extractors.py
@@ -233,6 +233,7 @@
     BrightcoveNewIE,
 )
 from .businessinsider import BusinessInsiderIE
+from .bundesliga import BundesligaIE
 from .buzzfeed import BuzzFeedIE
 from .byutv import BYUtvIE
 from .c56 import C56IE
diff --git a/yt_dlp/extractor/bundesliga.py b/yt_dlp/extractor/bundesliga.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/bundesliga.py
@@ -0,0 +1,34 @@
+from .common import InfoExtractor
+from .jwplatform import JWPlatformIE
+
+
+class BundesligaIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?bundesliga\.com/[a-z]{2}/bundesliga/videos(?:/[^?]+)?\?vid=(?P<id>[a-zA-Z0-9]{8})'
+    _TESTS = [
+        {
+            'url': 'https://www.bundesliga.com/en/bundesliga/videos?vid=bhhHkKyN',
+            'md5': '8fc3b25cd12440e3a8cdc51f1493849c',
+            'info_dict': {
+                'id': 'bhhHkKyN',
+                'ext': 'mp4',
+                'title': 'Watch: Alphonso Davies and Jeremie Frimpong head-to-head',
+                'thumbnail': 'https://cdn.jwplayer.com/v2/media/bhhHkKyN/poster.jpg?width=720',
+                'upload_date': '20220928',
+                'duration': 146,
+                'timestamp': 1664366511,
+                'description': 'md5:803d4411bd134140c774021dd4b7598b'
+            }
+        },
+        {
+            'url': 'https://www.bundesliga.com/en/bundesliga/videos/latest-features/T8IKc8TX?vid=ROHjs06G',
+            'only_matching': True
+        },
+        {
+            'url': 'https://www.bundesliga.com/en/bundesliga/videos/goals?vid=mOG56vWA',
+            'only_matching': True
+        }
+    ]
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        return self.url_result(f'jwplatform:{video_id}', JWPlatformIE, video_id)


Test patch: