summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <[email protected]>2013-09-23 21:28:33 +0200
committerJaime Marquínez Ferrándiz <[email protected]>2013-09-23 21:28:33 +0200
commita825f33030f189a37b1c3517ed1770a8b9e274fe (patch)
treeefdea1f3ffb916ec3fdb2ae041378703ab8442e2
parent92f618f2e22964d9b89781fd66164d6a02038111 (diff)
downloadyoutube-dl-a825f33030f189a37b1c3517ed1770a8b9e274fe.tar.gz
youtube-dl-a825f33030f189a37b1c3517ed1770a8b9e274fe.zip
[francetv] Add an extractor for France2
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/francetv.py22
2 files changed, 23 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 949f59a44..65aacebb3 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -42,6 +42,7 @@ from .flickr import FlickrIE
from .francetv import (
PluzzIE,
FranceTvInfoIE,
+ France2IE,
)
from .freesound import FreesoundIE
from .funnyordie import FunnyOrDieIE
diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py
index b8fe82e47..5e915bc03 100644
--- a/youtube_dl/extractor/francetv.py
+++ b/youtube_dl/extractor/francetv.py
@@ -65,3 +65,25 @@ class FranceTvInfoIE(FranceTVBaseInfoExtractor):
webpage = self._download_webpage(url, page_title)
video_id = self._search_regex(r'id-video=(\d+?)"', webpage, u'video id')
return self._extract_video(video_id)
+
+
+class France2IE(FranceTVBaseInfoExtractor):
+ IE_NAME = u'france2.fr'
+ _VALID_URL = r'https?://www\.france2\.fr/emissions/.*?/videos/(?P<id>\d+)'
+
+ _TEST = {
+ u'url': u'http://www.france2.fr/emissions/13h15-le-samedi-le-dimanche/videos/75540104',
+ u'file': u'75540104.mp4',
+ u'info_dict': {
+ u'title': u'13h15, le samedi...',
+ u'description': u'md5:2e5b58ba7a2d3692b35c792be081a03d',
+ },
+ u'params': {
+ u'skip_download': True,
+ },
+ }
+
+ def _real_extract(self, url):
+ mobj = re.match(self._VALID_URL, url)
+ video_id = mobj.group('id')
+ return self._extract_video(video_id)