diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-05-11 18:23:38 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-05-11 18:57:55 +0530 |
commit | d8ec40b39f29722ac409fdded41e5b47b918b1a7 (patch) | |
tree | becd53dd9034d0ce6e8302ce9626bddce3d761ca | |
parent | 41712218233ae144d55f841818df9c63d2bd23d3 (diff) | |
download | hypervideo-pre-d8ec40b39f29722ac409fdded41e5b47b918b1a7.tar.lz hypervideo-pre-d8ec40b39f29722ac409fdded41e5b47b918b1a7.tar.xz hypervideo-pre-d8ec40b39f29722ac409fdded41e5b47b918b1a7.zip |
[rmcdecouverte] Generalize `_VALID_URL`
Closes #291
-rw-r--r-- | yt_dlp/extractor/rmcdecouverte.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/yt_dlp/extractor/rmcdecouverte.py b/yt_dlp/extractor/rmcdecouverte.py index ecd16d130..655a58f9e 100644 --- a/yt_dlp/extractor/rmcdecouverte.py +++ b/yt_dlp/extractor/rmcdecouverte.py @@ -13,7 +13,7 @@ from ..utils import smuggle_url class RMCDecouverteIE(InfoExtractor): - _VALID_URL = r'https?://rmcdecouverte\.bfmtv\.com/(?:[^/]+/(?P<id>[^?#/]+)|(?P<live_id>mediaplayer-direct))' + _VALID_URL = r'https?://rmcdecouverte\.bfmtv\.com/(?:[^?#]*_(?P<id>\d+)|mediaplayer-direct)/?(?:[#?]|$)' _TESTS = [{ 'url': 'https://rmcdecouverte.bfmtv.com/vestiges-de-guerre_22240/les-bunkers-secrets-domaha-beach_25303/', @@ -46,6 +46,13 @@ class RMCDecouverteIE(InfoExtractor): }, 'skip': 'only available for a week', }, { + 'url': 'https://rmcdecouverte.bfmtv.com/avions-furtifs-la-technologie-de-lextreme_10598', + 'only_matching': True, + },{ + # The website accepts any URL as long as it has _\d+ at the end + 'url': 'https://rmcdecouverte.bfmtv.com/any/thing/can/go/here/_10598', + 'only_matching': True, + }, { # live, geo restricted, bypassable 'url': 'https://rmcdecouverte.bfmtv.com/mediaplayer-direct/', 'only_matching': True, @@ -54,7 +61,7 @@ class RMCDecouverteIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) - display_id = mobj.group('id') or mobj.group('live_id') + display_id = mobj.group('id') or 'direct' webpage = self._download_webpage(url, display_id) brightcove_legacy_url = BrightcoveLegacyIE._extract_brightcove_url(webpage) if brightcove_legacy_url: |