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