Repository: yt-dlp/yt-dlp

Issue:
The site TV5MONDE has changed its name for Video Archive
### 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 that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [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

Russia

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

February 1, 2024 website TV5MONDE has changed its name for Video Archive. Previously, the video archive was located at https://**revoir**.tv5monde.com/. Now the video archive is located at https://www.tv5monde.com/tv/video/.
The yt-dlp used to download videos using a direct link to the video, for example, https://www.tv5monde.com/tv/video/6136-vivre-sans-eux-vivre-sans-eux. Now the utility does not do this. Although the utility continues to download the video from the *.m3u8 received through Developer Tools/Network. Please make changes to the yt-dlp to be able to download videos via a direct link.

### 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
Microsoft Windows [Version 10.0.19045.3930]
(c) Корпорация Майкрософт (Microsoft Corporation). Все права защищены.

C:\Users\Internet>yt-dlp -vU https://www.tv5monde.com/tv/video/6136-vivre-sans-eux-vivre-sans-eux
[debug] Command-line config: ['-vU', 'https://www.tv5monde.com/tv/video/6136-vivre-sans-eux-vivre-sans-eux']
[debug] Encodings: locale cp1251, fs utf-8, pref cp1251, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.01.31.232703 from yt-dlp/yt-dlp-nightly-builds [fc2cc626f] (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-109960-g3153c441e1-20230303 (setts)
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1829 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.01.31.232703 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.01.31.232703 from yt-dlp/yt-dlp-nightly-builds)
[generic] Extracting URL: https://www.tv5monde.com/tv/video/6136-vivre-sans-eux-vivre-sans-eux
[generic] 6136-vivre-sans-eux-vivre-sans-eux: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] 6136-vivre-sans-eux-vivre-sans-eux: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://www.tv5monde.com/tv/video/6136-vivre-sans-eux-vivre-sans-eux
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1586, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1721, in __extract_info
  File "yt_dlp\extractor\common.py", line 718, in extract
  File "yt_dlp\extractor\generic.py", line 2531, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.tv5monde.com/tv/video/6136-vivre-sans-eux-vivre-sans-eux


C:\Users\Internet>
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/tv5mondeplus.py b/yt_dlp/extractor/tv5mondeplus.py
--- a/yt_dlp/extractor/tv5mondeplus.py
+++ b/yt_dlp/extractor/tv5mondeplus.py
@@ -2,85 +2,88 @@
 
 from .common import InfoExtractor
 from ..utils import (
+    clean_html,
     determine_ext,
     extract_attributes,
+    get_element_by_class,
+    get_element_html_by_class,
     int_or_none,
-    parse_duration,
-    traverse_obj,
-    try_get,
     url_or_none,
 )
+from ..utils.traversal import traverse_obj
 
 
 class TV5MondePlusIE(InfoExtractor):
-    IE_DESC = 'TV5MONDE+'
-    _VALID_URL = r'https?://(?:www\.)?(?:tv5mondeplus|revoir\.tv5monde)\.com/toutes-les-videos/[^/]+/(?P<id>[^/?#]+)'
+    IE_NAME = 'TV5MONDE'
+    _VALID_URL = r'https?://(?:www\.)?tv5monde\.com/tv/video/(?P<id>[^/?#]+)'
     _TESTS = [{
-        # movie
-        'url': 'https://revoir.tv5monde.com/toutes-les-videos/cinema/les-novices',
-        'md5': 'c86f60bf8b75436455b1b205f9745955',
+        # documentary
+        'url': 'https://www.tv5monde.com/tv/video/65931-baudouin-l-heritage-d-un-roi-baudouin-l-heritage-d-un-roi',
+        'md5': 'd2a708902d3df230a357c99701aece05',
         'info_dict': {
-            'id': 'ZX0ipMyFQq_6D4BA7b',
-            'display_id': 'les-novices',
+            'id': '3FPa7JMu21_6D4BA7b',
+            'display_id': '65931-baudouin-l-heritage-d-un-roi-baudouin-l-heritage-d-un-roi',
             'ext': 'mp4',
-            'title': 'Les novices',
-            'description': 'md5:2e7c33ba3ad48dabfcc2a956b88bde2b',
-            'upload_date': '20230821',
-            'thumbnail': 'https://revoir.tv5monde.com/uploads/media/video_thumbnail/0738/60/01e952b7ccf36b7c6007ec9131588954ab651de9.jpeg',
-            'duration': 5177,
-            'episode': 'Les novices',
+            'title': "Baudouin, l'héritage d'un roi",
+            'thumbnail': 'https://psi.tv5monde.com/upsilon-images/960x540/6f/baudouin-f49c6b0e.jpg',
+            'duration': 4842,
+            'upload_date': '20240130',
+            'timestamp': 1706641242,
+            'episode': "BAUDOUIN, L'HERITAGE D'UN ROI",
+            'description': 'md5:78125c74a5cac06d7743a2d09126edad',
+            'series': "Baudouin, l'héritage d'un roi",
         },
     }, {
         # series episode
-        'url': 'https://revoir.tv5monde.com/toutes-les-videos/series-fictions/opj-les-dents-de-la-terre-2',
+        'url': 'https://www.tv5monde.com/tv/video/52952-toute-la-vie-mardi-23-mars-2021',
+        'md5': 'f5e09637cadd55639c05874e22eb56bf',
         'info_dict': {
-            'id': 'wJ0eeEPozr_6D4BA7b',
-            'display_id': 'opj-les-dents-de-la-terre-2',
+            'id': 'obRRZ8m6g9_6D4BA7b',
+            'display_id': '52952-toute-la-vie-mardi-23-mars-2021',
             'ext': 'mp4',
-            'title': "OPJ - Les dents de la Terre (2)",
-            'description': 'md5:288f87fd68d993f814e66e60e5302d9d',
-            'upload_date': '20230823',
-            'series': 'OPJ',
-            'episode': 'Les dents de la Terre (2)',
-            'duration': 2877,
-            'thumbnail': 'https://dl-revoir.tv5monde.com/images/1a/5753448.jpg'
+            'title': 'Toute la vie',
+            'description': 'md5:a824a2e1dfd94cf45fa379a1fb43ce65',
+            'thumbnail': 'https://psi.tv5monde.com/media/image/960px/5880553.jpg',
+            'duration': 2526,
+            'upload_date': '20230721',
+            'timestamp': 1689971646,
+            'series': 'Toute la vie',
+            'episode': 'Mardi 23 mars 2021',
         },
     }, {
         # movie
-        'url': 'https://revoir.tv5monde.com/toutes-les-videos/cinema/ceux-qui-travaillent',
-        'md5': '32fa0cde16a4480d1251502a66856d5f',
+        'url': 'https://www.tv5monde.com/tv/video/8771-ce-fleuve-qui-nous-charrie-ce-fleuve-qui-nous-charrie-p001-ce-fleuve-qui-nous-charrie',
+        'md5': '87cefc34e10a6bf4f7823cccd7b36eb2',
         'info_dict': {
-            'id': 'dc57a011-ec4b-4648-2a9a-4f03f8352ed3',
-            'display_id': 'ceux-qui-travaillent',
+            'id': 'DOcfvdLKXL_6D4BA7b',
+            'display_id': '8771-ce-fleuve-qui-nous-charrie-ce-fleuve-qui-nous-charrie-p001-ce-fleuve-qui-nous-charrie',
             'ext': 'mp4',
-            'title': 'Ceux qui travaillent',
-            'description': 'md5:570e8bb688036ace873b2d50d24c026d',
-            'upload_date': '20210819',
+            'title': 'Ce fleuve qui nous charrie',
+            'description': 'md5:62ba3f875343c7fc4082bdfbbc1be992',
+            'thumbnail': 'https://psi.tv5monde.com/media/image/960px/5476617.jpg',
+            'duration': 5300,
+            'upload_date': '20210822',
+            'timestamp': 1629594105,
+            'episode': 'CE FLEUVE QUI NOUS CHARRIE-P001-CE FLEUVE QUI NOUS CHARRIE',
+            'series': 'Ce fleuve qui nous charrie',
         },
-        'skip': 'no longer available',
     }, {
-        # series episode
-        'url': 'https://revoir.tv5monde.com/toutes-les-videos/series-fictions/vestiaires-caro-actrice',
+        # news
+        'url': 'https://www.tv5monde.com/tv/video/70402-tv5monde-le-journal-edition-du-08-05-24-11h',
+        'md5': 'c62977d6d10754a2ecebba70ad370479',
         'info_dict': {
-            'id': '9e9d599e-23af-6915-843e-ecbf62e97925',
-            'display_id': 'vestiaires-caro-actrice',
+            'id': 'LgQFrOCNsc_6D4BA7b',
+            'display_id': '70402-tv5monde-le-journal-edition-du-08-05-24-11h',
             'ext': 'mp4',
-            'title': "Vestiaires - Caro actrice",
-            'description': 'md5:db15d2e1976641e08377f942778058ea',
-            'upload_date': '20210819',
-            'series': "Vestiaires",
-            'episode': 'Caro actrice',
-        },
-        'params': {
-            'skip_download': True,
+            'title': 'TV5MONDE, le journal',
+            'description': 'md5:777dc209eaa4423b678477c36b0b04a8',
+            'thumbnail': 'https://psi.tv5monde.com/media/image/960px/6184105.jpg',
+            'duration': 854,
+            'upload_date': '20240508',
+            'timestamp': 1715159640,
+            'series': 'TV5MONDE, le journal',
+            'episode': 'EDITION DU 08/05/24 - 11H',
         },
-        'skip': 'no longer available',
-    }, {
-        'url': 'https://revoir.tv5monde.com/toutes-les-videos/series-fictions/neuf-jours-en-hiver-neuf-jours-en-hiver',
-        'only_matching': True,
-    }, {
-        'url': 'https://revoir.tv5monde.com/toutes-les-videos/info-societe/le-journal-de-la-rts-edition-du-30-01-20-19h30',
-        'only_matching': True,
     }]
     _GEO_BYPASS = False
 
@@ -98,7 +101,6 @@ def _real_extract(self, url):
         if ">Ce programme n'est malheureusement pas disponible pour votre zone géographique.<" in webpage:
             self.raise_geo_restricted(countries=['FR'])
 
-        title = episode = self._html_search_regex(r'<h1>([^<]+)', webpage, 'title')
         vpl_data = extract_attributes(self._search_regex(
             r'(<[^>]+class="video_player_loader"[^>]+>)',
             webpage, 'video player loader'))
@@ -147,26 +149,7 @@ def process_video_files(v):
         process_video_files(video_files)
 
         metadata = self._parse_json(
-            vpl_data['data-metadata'], display_id)
-        duration = (int_or_none(try_get(metadata, lambda x: x['content']['duration']))
-                    or parse_duration(self._html_search_meta('duration', webpage)))
-
-        description = self._html_search_regex(
-            r'(?s)<div[^>]+class=["\']episode-texte[^>]+>(.+?)</div>', webpage,
-            'description', fatal=False)
-
-        series = self._html_search_regex(
-            r'<p[^>]+class=["\']episode-emission[^>]+>([^<]+)', webpage,
-            'series', default=None)
-
-        if series and series != title:
-            title = '%s - %s' % (series, title)
-
-        upload_date = self._search_regex(
-            r'(?:date_publication|publish_date)["\']\s*:\s*["\'](\d{4}_\d{2}_\d{2})',
-            webpage, 'upload date', default=None)
-        if upload_date:
-            upload_date = upload_date.replace('_', '')
+            vpl_data.get('data-metadata') or '{}', display_id, fatal=False)
 
         if not video_id:
             video_id = self._search_regex(
@@ -175,16 +158,20 @@ def process_video_files(v):
                 default=display_id)
 
         return {
+            **traverse_obj(metadata, ('content', {
+                'id': ('id', {str}),
+                'title': ('title', {str}),
+                'episode': ('title', {str}),
+                'series': ('series', {str}),
+                'timestamp': ('publishDate_ts', {int_or_none}),
+                'duration': ('duration', {int_or_none}),
+            })),
             'id': video_id,
             'display_id': display_id,
-            'title': title,
-            'description': description,
-            'thumbnail': vpl_data.get('data-image'),
-            'duration': duration,
-            'upload_date': upload_date,
+            'title': clean_html(get_element_by_class('main-title', webpage)),
+            'description': clean_html(get_element_by_class('text', get_element_html_by_class('ep-summary', webpage) or '')),
+            'thumbnail': url_or_none(vpl_data.get('data-image')),
             'formats': formats,
             'subtitles': self._extract_subtitles(self._parse_json(
                 traverse_obj(vpl_data, ('data-captions', {str}), default='{}'), display_id, fatal=False)),
-            'series': series,
-            'episode': episode,
         }


Test patch: