2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from .arkena import ArkenaIE
8 class LcpPlayIE(ArkenaIE):
9 _VALID_URL = r'https?://play\.lcp\.fr/embed/(?P<id>[^/]+)/(?P<account_id>[^/]+)/[^/]+/[^/]+'
11 'url': 'http://play.lcp.fr/embed/327336/131064/darkmatter/0',
12 'md5': 'b8bd9298542929c06c1c15788b1f277a',
17 'timestamp': 1456391602,
18 'upload_date': '20160225',
21 'skip_download': True,
26 class LcpIE(InfoExtractor):
27 _VALID_URL = r'https?://(?:www\.)?lcp\.fr/(?:[^/]+/)*(?P<id>[^/]+)'
31 'url': 'http://www.lcp.fr/la-politique-en-video/schwartzenberg-prg-preconise-francois-hollande-de-participer-une-primaire',
32 'md5': 'b8bd9298542929c06c1c15788b1f277a',
36 'title': 'Schwartzenberg (PRG) préconise à François Hollande de participer à une primaire à gauche',
37 'description': 'md5:96ad55009548da9dea19f4120c6c16a8',
38 'timestamp': 1456488895,
39 'upload_date': '20160226',
42 'skip_download': True,
45 # dailymotion live stream
46 'url': 'http://www.lcp.fr/le-direct',
50 'title': 'La Chaine Parlementaire (LCP), Live TNT',
51 'description': 'md5:5c69593f2de0f38bd9a949f2c95e870b',
53 'uploader_id': 'xbz33d',
54 'timestamp': 1308923058,
55 'upload_date': '20110624',
59 'skip_download': True,
62 'url': 'http://www.lcp.fr/emissions/277792-les-volontaires',
63 'only_matching': True,
66 def _real_extract(self, url):
67 display_id = self._match_id(url)
69 webpage = self._download_webpage(url, display_id)
71 play_url = self._search_regex(
72 r'<iframe[^>]+src=(["\'])(?P<url>%s?(?:(?!\1).)*)\1' % LcpPlayIE._VALID_URL,
73 webpage, 'play iframe', default=None, group='url')
76 return self.url_result(url, 'Generic')
78 title = self._og_search_title(webpage, default=None) or self._html_search_meta(
79 'twitter:title', webpage, fatal=True)
80 description = self._html_search_meta(
81 ('description', 'twitter:description'), webpage)
84 '_type': 'url_transparent',
85 'ie_key': LcpPlayIE.ie_key(),
87 'display_id': display_id,
89 'description': description,