2 from __future__ import unicode_literals
4 from .common import InfoExtractor
13 class FranceCultureIE(InfoExtractor):
14 _VALID_URL = r'https?://(?:www\.)?franceculture\.fr/emissions/(?:[^/]+/)*(?P<id>[^/?#&]+)'
16 'url': 'http://www.franceculture.fr/emissions/carnet-nomade/rendez-vous-au-pays-des-geeks',
18 'id': 'rendez-vous-au-pays-des-geeks',
19 'display_id': 'rendez-vous-au-pays-des-geeks',
21 'title': 'Rendez-vous au pays des geeks',
22 'thumbnail': r're:^https?://.*\.jpg$',
23 'upload_date': '20140301',
24 'timestamp': 1393642916,
29 def _real_extract(self, url):
30 display_id = self._match_id(url)
32 webpage = self._download_webpage(url, display_id)
34 video_data = extract_attributes(self._search_regex(
35 r'(?s)<div[^>]+class="[^"]*?(?:title-zone-diffusion|heading-zone-(?:wrapper|player-button))[^"]*?"[^>]*>.*?(<button[^>]+data-asset-source="[^"]+"[^>]+>)',
36 webpage, 'video data'))
38 video_url = video_data['data-asset-source']
39 title = video_data.get('data-asset-title') or self._og_search_title(webpage)
41 description = self._html_search_regex(
42 r'(?s)<div[^>]+class="intro"[^>]*>.*?<h2>(.+?)</h2>',
43 webpage, 'description', default=None)
44 thumbnail = self._search_regex(
45 r'(?s)<figure[^>]+itemtype="https://schema.org/ImageObject"[^>]*>.*?<img[^>]+(?:data-dejavu-)?src="([^"]+)"',
46 webpage, 'thumbnail', fatal=False)
47 uploader = self._html_search_regex(
48 r'(?s)<span class="author">(.*?)</span>',
49 webpage, 'uploader', default=None)
50 ext = determine_ext(video_url.lower())
54 'display_id': display_id,
57 'description': description,
58 'thumbnail': thumbnail,
60 'vcodec': 'none' if ext == 'mp3' else None,
62 'timestamp': int_or_none(video_data.get('data-asset-created-date')),
63 'duration': int_or_none(video_data.get('data-duration')),