1 from .common
import InfoExtractor
2 from .brightcove
import BrightcoveLegacyIE
7 from ..utils
import smuggle_url
10 class RMCDecouverteIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://rmcdecouverte\.bfmtv\.com/(?:[^?#]*_(?P<id>\d+)|mediaplayer-direct)/?(?:[#?]|$)'
14 'url': 'https://rmcdecouverte.bfmtv.com/vestiges-de-guerre_22240/les-bunkers-secrets-domaha-beach_25303/',
16 'id': '6250879771001',
18 'title': 'LES BUNKERS SECRETS DĀ“OMAHA BEACH',
19 'uploader_id': '1969646226001',
20 'description': 'md5:aed573ca24abde62a148e0eba909657d',
21 'timestamp': 1619622984,
22 'upload_date': '20210428',
25 'skip_download': True,
28 'url': 'https://rmcdecouverte.bfmtv.com/wheeler-dealers-occasions-a-saisir/program_2566/',
30 'id': '5983675500001',
33 'description': 'md5:c1e8295521e45ffebf635d6a7658f506',
34 'uploader_id': '1969646226001',
35 'upload_date': '20181226',
36 'timestamp': 1545861635,
39 'skip_download': True,
41 'skip': 'only available for a week',
43 'url': 'https://rmcdecouverte.bfmtv.com/avions-furtifs-la-technologie-de-lextreme_10598',
44 'only_matching': True,
46 # The website accepts any URL as long as it has _\d+ at the end
47 'url': 'https://rmcdecouverte.bfmtv.com/any/thing/can/go/here/_10598',
48 'only_matching': True,
50 # live, geo restricted, bypassable
51 'url': 'https://rmcdecouverte.bfmtv.com/mediaplayer-direct/',
52 'only_matching': True,
54 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/1969646226001/default_default/index.html?videoId=%s'
56 def _real_extract(self
, url
):
57 mobj
= self
._match
_valid
_url
(url
)
58 display_id
= mobj
.group('id') or 'direct'
59 webpage
= self
._download
_webpage
(url
, display_id
)
60 brightcove_legacy_url
= BrightcoveLegacyIE
._extract
_brightcove
_url
(webpage
)
61 if brightcove_legacy_url
:
62 brightcove_id
= compat_parse_qs(compat_urlparse
.urlparse(
63 brightcove_legacy_url
).query
)['@videoPlayer'][0]
65 brightcove_id
= self
._search
_regex
(
66 r
'data-video-id=["\'](\d
+)', webpage, 'brightcove
id')
67 return self.url_result(
69 self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id,
70 {'geo_countries
': ['FR
']}),
71 'BrightcoveNew
', brightcove_id)