2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..utils import int_or_none
8 class FranceInterIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]+)'
11 'url': 'http://www.franceinter.fr/player/reecouter?play=793962',
12 'md5': '4764932e466e6f6c79c317d2e74f6884',
16 'title': 'L’Histoire dans les jeux vidéo',
17 'description': 'md5:7e93ddb4451e7530022792240a3049c7',
18 'timestamp': 1387369800,
19 'upload_date': '20131218',
23 def _real_extract(self, url):
24 video_id = self._match_id(url)
26 webpage = self._download_webpage(url, video_id)
28 path = self._search_regex(
29 r'<a id="player".+?href="([^"]+)"', webpage, 'video url')
30 video_url = 'http://www.franceinter.fr/' + path
32 title = self._html_search_regex(
33 r'<span class="title-diffusion">(.+?)</span>', webpage, 'title')
34 description = self._html_search_regex(
35 r'<span class="description">(.*?)</span>',
36 webpage, 'description', fatal=False)
37 timestamp = int_or_none(self._search_regex(
38 r'data-date="(\d+)"', webpage, 'upload date', fatal=False))
43 'description': description,
44 'timestamp': timestamp,