From 1f8489cccbdc6e96027ef527b88717458f0900e8 Mon Sep 17 00:00:00 2001 From: Chris Caruso Date: Sat, 4 Mar 2023 11:22:11 -0800 Subject: [PATCH] [extractor/lumni] Add extractor (#6302) Authored by: carusocr Closes #6202 --- yt_dlp/extractor/_extractors.py | 3 +++ yt_dlp/extractor/lumni.py | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 yt_dlp/extractor/lumni.py diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py index 0731845bae..ccac634b3d 100644 --- a/yt_dlp/extractor/_extractors.py +++ b/yt_dlp/extractor/_extractors.py @@ -962,6 +962,9 @@ from .lrt import ( LRTVODIE, LRTStreamIE ) +from .lumni import ( + LumniIE +) from .lynda import ( LyndaIE, LyndaCourseIE diff --git a/yt_dlp/extractor/lumni.py b/yt_dlp/extractor/lumni.py new file mode 100644 index 0000000000..5810da0c8c --- /dev/null +++ b/yt_dlp/extractor/lumni.py @@ -0,0 +1,24 @@ +from .common import InfoExtractor +from .francetv import FranceTVIE + + +class LumniIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?lumni\.fr/video/(?P[\w-]+)' + _TESTS = [{ + 'url': 'https://www.lumni.fr/video/l-homme-et-son-environnement-dans-la-revolution-industrielle', + 'md5': '960e8240c4f2c7a20854503a71e52f5e', + 'info_dict': { + 'id': 'd2b9a4e5-a526-495b-866c-ab72737e3645', + 'ext': 'mp4', + 'title': "L'homme et son environnement dans la révolution industrielle - L'ère de l'homme", + 'thumbnail': 'https://assets.webservices.francetelevisions.fr/v1/assets/images/a7/17/9f/a7179f5f-63a5-4e11-8d4d-012ab942d905.jpg', + 'duration': 230, + } + }] + + def _real_extract(self, url): + display_id = self._match_id(url) + webpage = self._download_webpage(url, display_id) + video_id = self._html_search_regex( + r']+data-factoryid\s*=\s*["\']([^"\']+)', webpage, 'video id') + return self.url_result(f'francetv:{video_id}', FranceTVIE, video_id)