aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-01-08 16:16:34 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-01-08 16:16:34 +0100
commit469ec9416a813f845df0df06a077a008597d83d9 (patch)
treee46e7f84c82d068d6a7d602a46332d786fed515c
parent70af3439e92483e18d0e710362072bc2616b20c2 (diff)
[francetv] Add extractor for Culturebox (closes #2117)
-rw-r--r--youtube_dl/extractor/__init__.py3
-rw-r--r--youtube_dl/extractor/francetv.py26
2 files changed, 28 insertions, 1 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index e813ba976..b887c7f10 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -65,7 +65,8 @@ from .francetv import (
PluzzIE,
FranceTvInfoIE,
FranceTVIE,
- GenerationQuoiIE
+ GenerationQuoiIE,
+ CultureboxIE,
)
from .freesound import FreesoundIE
from .funnyordie import FunnyOrDieIE
diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py
index ad85bc16d..b32ff9f86 100644
--- a/youtube_dl/extractor/francetv.py
+++ b/youtube_dl/extractor/francetv.py
@@ -191,3 +191,29 @@ class GenerationQuoiIE(InfoExtractor):
info = json.loads(info_json)
return self.url_result('http://www.dailymotion.com/video/%s' % info['id'],
ie='Dailymotion')
+
+
+class CultureboxIE(FranceTVBaseInfoExtractor):
+ IE_NAME = u'culturebox.francetvinfo.fr'
+ _VALID_URL = r'https?://culturebox\.francetvinfo\.fr/(?P<name>.*?)(\?|$)'
+
+ _TEST = {
+ u'url': u'http://culturebox.francetvinfo.fr/einstein-on-the-beach-au-theatre-du-chatelet-146813',
+ u'info_dict': {
+ u'id': u'EV_6785',
+ u'ext': u'mp4',
+ u'title': u'Einstein on the beach au Théâtre du Châtelet',
+ u'description': u'md5:9ce2888b1efefc617b5e58b3f6200eeb',
+ },
+ u'params': {
+ # m3u8 download
+ u'skip_download': True,
+ },
+ }
+
+ def _real_extract(self, url):
+ mobj = re.match(self._VALID_URL, url)
+ name = mobj.group('name')
+ webpage = self._download_webpage(url, name)
+ video_id = self._search_regex(r'"http://videos\.francetv\.fr/video/(.*?)"', webpage, u'video id')
+ return self._extract_video(video_id)