Repository: yt-dlp/yt-dlp

Issue:
CERTVG
### 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 new site support request
- [X] I've verified that I'm running yt-dlp version **2023.03.04** ([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 none of provided URLs [violate any copyrights](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-website-primarily-used-for-piracy) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [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)
- [ ] 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

Spain

### Example URLs

- Single video https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623

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

The video is being served in pieces.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
yt-dlp -vU https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623
[debug] Command-line config: ['-vU', 'https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (pip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.4.0-144-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Optional libraries: Cryptodome-3.14.1, brotli-1.0.9, certifi-2019.11.28, mutagen-1.45.1, secretstorage-3.1.0, sqlite3-2.6.0, websockets-10.2
[debug] Proxy map: {}
[debug] Loaded 1786 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
yt-dlp is up to date (stable@2023.03.04)
[generic] Extracting URL: https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623
[generic] os-caimans-do-tea-5839623: Downloading webpage
[redirect] Following redirect to http://www.crtvg.es/agalegaendirecto/
[generic] Extracting URL: http://www.crtvg.es/agalegaendirecto/
[generic] agalegaendirecto: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] agalegaendirecto: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: http://www.crtvg.es/agalegaendirecto/
Traceback (most recent call last):
  File "/home/myuser/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1518, in wrapper
    return func(self, *args, **kwargs)
  File "/home/myuser/.local/lib/python3.8/site-packages/yt_dlp/YoutubeDL.py", line 1594, in __extract_info
    ie_result = ie.extract(url)
  File "/home/myuser/.local/lib/python3.8/site-packages/yt_dlp/extractor/common.py", line 694, in extract
    ie_result = self._real_extract(url)
  File "/home/myuser/.local/lib/python3.8/site-packages/yt_dlp/extractor/generic.py", line 2510, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: http://www.crtvg.es/agalegaendirecto/
```



Discussion:
Note for devs:

in the webpage source there a JS block
```html
<script type="text/javascript">

	var urlCompartirJW = window.location.href;

	var url = "https://ondemand-crtvg-origin.flumotion.com/videos/MD/2022/10/ac818cb4-6dc9-4377-8acf-20d5b2a6e601.mp4";
```
the url var needs to have `/playlist.m3u8` or `/manifest.mpd` appended to it, e.g.

https://ondemand-crtvg-origin.flumotion.com/videos/MD/2022/10/ac818cb4-6dc9-4377-8acf-20d5b2a6e601.mp4/playlist.m3u8

https://ondemand-crtvg-origin.flumotion.com/videos/MD/2022/10/ac818cb4-6dc9-4377-8acf-20d5b2a6e601.mp4/manifest.mpd

OP: you can pass one of these manifest URLs to yt-dlp if you want to download the video now w/o waiting for an extractor to be added (the m3u8 has much faster d/l speed than mpd)
> Note for devs:
> 
> in the webpage source there a JS block
> 
> ```
> <script type="text/javascript">
> 
> 	var urlCompartirJW = window.location.href;
> 
> 	var url = "https://ondemand-crtvg-origin.flumotion.com/videos/MD/2022/10/ac818cb4-6dc9-4377-8acf-20d5b2a6e601.mp4";
> ```
> 
> the url var needs to have `/playlist.m3u8` or `/manifest.mpd` appended to it, e.g.
> 
> https://ondemand-crtvg-origin.flumotion.com/videos/MD/2022/10/ac818cb4-6dc9-4377-8acf-20d5b2a6e601.mp4/playlist.m3u8
> 
> https://ondemand-crtvg-origin.flumotion.com/videos/MD/2022/10/ac818cb4-6dc9-4377-8acf-20d5b2a6e601.mp4/manifest.mpd
> 
> OP: you can pass one of these manifest URLs to yt-dlp if you want to download the video now w/o waiting for an extractor to be added (the m3u8 has much faster d/l speed than mpd)


I'll work on it..

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
@@ -407,6 +407,7 @@
     CrowdBunkerIE,
     CrowdBunkerChannelIE,
 )
+from .crtvg import CrtvgIE
 from .crunchyroll import (
     CrunchyrollBetaIE,
     CrunchyrollBetaShowIE,
diff --git a/yt_dlp/extractor/crtvg.py b/yt_dlp/extractor/crtvg.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/crtvg.py
@@ -0,0 +1,34 @@
+from .common import InfoExtractor
+from ..utils import remove_end
+
+
+class CrtvgIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?crtvg\.es/tvg/a-carta/[^/#?]+-(?P<id>\d+)'
+    _TESTS = [{
+        'url': 'https://www.crtvg.es/tvg/a-carta/os-caimans-do-tea-5839623',
+        'md5': 'c0958d9ff90e4503a75544358758921d',
+        'info_dict': {
+            'id': '5839623',
+            'title': 'Os caimáns do Tea',
+            'ext': 'mp4',
+            'description': 'md5:f71cfba21ae564f0a6f415b31de1f842',
+            'thumbnail': r're:^https?://.*\.(?:jpg|png)',
+        },
+        'params': {'skip_download': 'm3u8'}
+    }]
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+        video_url = self._search_regex(r'var\s+url\s*=\s*["\']([^"\']+)', webpage, 'video url')
+        formats = self._extract_m3u8_formats(video_url + '/playlist.m3u8', video_id, fatal=False)
+        formats.extend(self._extract_mpd_formats(video_url + '/manifest.mpd', video_id, fatal=False))
+
+        return {
+            'id': video_id,
+            'formats': formats,
+            'title': remove_end(self._html_search_meta(
+                ['og:title', 'twitter:title'], webpage, 'title', default=None), ' | CRTVG'),
+            'description': self._html_search_meta('description', webpage, 'description', default=None),
+            'thumbnail': self._html_search_meta(['og:image', 'twitter:image'], webpage, 'thumbnail', default=None),
+        }


Test patch: