[ie/wistia] Support password-protected videos (#11100)
[yt-dlp3.git] / yt_dlp / extractor / lemonde.py
blobc916791af5fd10f6fee469bbbf3ba80618d7b032
1 from .common import InfoExtractor
4 class LemondeIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:.+?\.)?lemonde\.fr/(?:[^/]+/)*(?P<id>[^/]+)\.html'
6 _TESTS = [{
7 'url': 'http://www.lemonde.fr/police-justice/video/2016/01/19/comprendre-l-affaire-bygmalion-en-cinq-minutes_4849702_1653578.html',
8 'md5': 'da120c8722d8632eec6ced937536cc98',
9 'info_dict': {
10 'id': 'lqm3kl',
11 'ext': 'mp4',
12 'title': "Comprendre l'affaire Bygmalion en 5 minutes",
13 'thumbnail': r're:^https?://.*\.jpg',
14 'duration': 309,
15 'upload_date': '20160119',
16 'timestamp': 1453194778,
17 'uploader_id': '3pmkp',
19 }, {
20 # standard iframe embed
21 'url': 'http://www.lemonde.fr/les-decodeurs/article/2016/10/18/tout-comprendre-du-ceta-le-petit-cousin-du-traite-transatlantique_5015920_4355770.html',
22 'info_dict': {
23 'id': 'uzsxms',
24 'ext': 'mp4',
25 'title': "CETA : quelles suites pour l'accord commercial entre l'Europe et le Canada ?",
26 'thumbnail': r're:^https?://.*\.jpg',
27 'duration': 325,
28 'upload_date': '20161021',
29 'timestamp': 1477044540,
30 'uploader_id': '3pmkp',
32 'params': {
33 'skip_download': True,
35 }, {
36 'url': 'http://redaction.actu.lemonde.fr/societe/video/2016/01/18/calais-debut-des-travaux-de-defrichement-dans-la-jungle_4849233_3224.html',
37 'only_matching': True,
38 }, {
39 # YouTube embeds
40 'url': 'http://www.lemonde.fr/pixels/article/2016/12/09/pourquoi-pewdiepie-superstar-de-youtube-a-menace-de-fermer-sa-chaine_5046649_4408996.html',
41 'only_matching': True,
44 def _real_extract(self, url):
45 display_id = self._match_id(url)
47 webpage = self._download_webpage(url, display_id)
49 digiteka_url = self._proto_relative_url(self._search_regex(
50 r'url\s*:\s*(["\'])(?P<url>(?:https?://)?//(?:www\.)?(?:digiteka\.net|ultimedia\.com)/deliver/.+?)\1',
51 webpage, 'digiteka url', group='url', default=None))
53 if digiteka_url:
54 return self.url_result(digiteka_url, 'Digiteka')
56 return self.url_result(url, 'Generic')