]>
Commit | Line | Data |
---|---|---|
677b3ce8 | 1 | # coding: utf-8 |
c8650f7e | 2 | from __future__ import unicode_literals |
3 | ||
bf6705f5 SH |
4 | import re |
5 | ||
6 | from .common import InfoExtractor | |
677b3ce8 PH |
7 | |
8 | ||
bf6705f5 | 9 | class FranceInterIE(InfoExtractor): |
677b3ce8 PH |
10 | _VALID_URL = r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})' |
11 | _TEST = { | |
12 | 'url': 'http://www.franceinter.fr/player/reecouter?play=793962', | |
13 | 'file': '793962.mp3', | |
14 | 'md5': '4764932e466e6f6c79c317d2e74f6884', | |
15 | "info_dict": { | |
16 | "title": "L’Histoire dans les jeux vidéo", | |
17 | }, | |
18 | } | |
bf6705f5 | 19 | |
677b3ce8 | 20 | def _real_extract(self, url): |
bf6705f5 SH |
21 | mobj = re.match(self._VALID_URL, url) |
22 | video_id = mobj.group('id') | |
26844eb5 | 23 | |
677b3ce8 PH |
24 | webpage = self._download_webpage(url, video_id) |
25 | title = self._html_search_regex( | |
26 | r'<span class="roll_overflow">(.*?)</span></h1>', webpage, 'title') | |
27 | path = self._search_regex( | |
28 | r'&urlAOD=(.*?)&startTime', webpage, 'video url') | |
29 | video_url = 'http://www.franceinter.fr/' + path | |
30 | ||
31 | return { | |
32 | 'id': video_id, | |
33 | 'formats': [{ | |
34 | 'url': video_url, | |
35 | 'vcodec': 'none', | |
36 | }], | |
37 | 'title': title, | |
38 | } |