aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-01-17 03:09:07 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-01-17 03:09:07 +0100
commit677b3ce82f7bb27f614f3972a6d6581bf89e14a6 (patch)
tree65736950ab7cc73d18c212c3f3cb5441834c9538 /youtube_dl/extractor
parentfabfe17d5e783eaed7d3fb15a323756c031bcf4f (diff)
[franceinter] Minor improvements (#2152)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/franceinter.py49
1 files changed, 29 insertions, 20 deletions
diff --git a/youtube_dl/extractor/franceinter.py b/youtube_dl/extractor/franceinter.py
index 932a1f161..7728410da 100644
--- a/youtube_dl/extractor/franceinter.py
+++ b/youtube_dl/extractor/franceinter.py
@@ -1,31 +1,40 @@
+# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
+
+
class FranceInterIE(InfoExtractor):
-
- _VALID_URL=r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
- _TEST={
- u'url':u'http://www.franceinter.fr/player/reecouter?play=793962',
- u'file':u'793962.mp3'
-
- }
-
-
-
-
- def _real_extract(self,url):
+ _VALID_URL = r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
+ _TEST = {
+ 'url': 'http://www.franceinter.fr/player/reecouter?play=793962',
+ 'file': '793962.mp3',
+ 'md5': '4764932e466e6f6c79c317d2e74f6884',
+ "info_dict": {
+ "title": "L’Histoire dans les jeux vidéo",
+ },
+ }
+ def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
- webpage=self._download_webpage(url,video_id)
-
- title=self._search_regex(u'(?<=<span class="roll_overflow">)(.*)(?=</span></h1>)', webpage, u'title')
-
- video_url='http://www.franceinter.fr/'+self._search_regex(u'(?<=&urlAOD=)(.*)(?=&startTime)', webpage, u'video url')
-
- return{'id': video_id,u'url': video_url,u'title': title}
-
+ webpage = self._download_webpage(url, video_id)
+ title = self._html_search_regex(
+ r'<span class="roll_overflow">(.*?)</span></h1>', webpage, 'title')
+ path = self._search_regex(
+ r'&urlAOD=(.*?)&startTime', webpage, 'video url')
+ video_url = 'http://www.franceinter.fr/' + path
+
+ return {
+ 'id': video_id,
+ 'formats': [{
+ 'url': video_url,
+ 'vcodec': 'none',
+ }],
+ 'title': title,
+ }
+
\ No newline at end of file