]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rmcdecouverte.py
422d47ae9f7f57b133679865ad00fb4f38902eca
2 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from .brightcove
import BrightcoveLegacyIE
11 from ..utils
import smuggle_url
14 class RMCDecouverteIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://rmcdecouverte\.bfmtv\.com/(?:[^?#]*_(?P<id>\d+)|mediaplayer-direct)/?(?:[#?]|$)'
18 'url': 'https://rmcdecouverte.bfmtv.com/vestiges-de-guerre_22240/les-bunkers-secrets-domaha-beach_25303/',
20 'id': '6250879771001',
22 'title': 'LES BUNKERS SECRETS DĀ“OMAHA BEACH',
23 'uploader_id': '1969646226001',
24 'description': 'md5:aed573ca24abde62a148e0eba909657d',
25 'timestamp': 1619622984,
26 'upload_date': '20210428',
29 'format': 'bestvideo',
30 'skip_download': True,
33 'url': 'https://rmcdecouverte.bfmtv.com/wheeler-dealers-occasions-a-saisir/program_2566/',
35 'id': '5983675500001',
38 'description': 'md5:c1e8295521e45ffebf635d6a7658f506',
39 'uploader_id': '1969646226001',
40 'upload_date': '20181226',
41 'timestamp': 1545861635,
44 'skip_download': True,
46 'skip': 'only available for a week',
48 'url': 'https://rmcdecouverte.bfmtv.com/avions-furtifs-la-technologie-de-lextreme_10598',
49 'only_matching': True,
51 # The website accepts any URL as long as it has _\d+ at the end
52 'url': 'https://rmcdecouverte.bfmtv.com/any/thing/can/go/here/_10598',
53 'only_matching': True,
55 # live, geo restricted, bypassable
56 'url': 'https://rmcdecouverte.bfmtv.com/mediaplayer-direct/',
57 'only_matching': True,
59 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/1969646226001/default_default/index.html?videoId=%s'
61 def _real_extract(self
, url
):
62 mobj
= self
._match
_valid
_url
(url
)
63 display_id
= mobj
.group('id') or 'direct'
64 webpage
= self
._download
_webpage
(url
, display_id
)
65 brightcove_legacy_url
= BrightcoveLegacyIE
._extract
_brightcove
_url
(webpage
)
66 if brightcove_legacy_url
:
67 brightcove_id
= compat_parse_qs(compat_urlparse
.urlparse(
68 brightcove_legacy_url
).query
)['@videoPlayer'][0]
70 brightcove_id
= self
._search
_regex
(
71 r
'data-video-id=["\'](\d
+)', webpage, 'brightcove
id')
72 return self.url_result(
74 self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id,
75 {'geo_countries': ['FR']}),
76 'BrightcoveNew
', brightcove_id)