about summary refs log tree commit diff
path: root/youtube_dl/extractor/eitb.py
diff options
context:
space:
mode:
authorrzhxeo <rzhxeot7z81b4700@mailcatch.com>2013-11-18 00:27:06 +0100
committerrzhxeo <rzhxeot7z81b4700@mailcatch.com>2013-11-18 00:27:06 +0100
commit2b35c9ef742bf261078ea10c6c0bba848db1a0df (patch)
treefe80c838c7529c8cab6f1b44d730a2849cd68c48 /youtube_dl/extractor/eitb.py
parent4894fe8c5baec8b1f21ac6fdebe08175abc7f094 (diff)
parent73c566695fac926e7e9e6922fe4e6d82c64a1850 (diff)
downloadyoutube-dl-2b35c9ef742bf261078ea10c6c0bba848db1a0df.tar.gz
youtube-dl-2b35c9ef742bf261078ea10c6c0bba848db1a0df.tar.xz
youtube-dl-2b35c9ef742bf261078ea10c6c0bba848db1a0df.zip
Merge branch 'master' into rtmpdump
Conflicts:
	youtube_dl/FileDownloader.py

Merge
Diffstat (limited to 'youtube_dl/extractor/eitb.py')
-rw-r--r--youtube_dl/extractor/eitb.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/youtube_dl/extractor/eitb.py b/youtube_dl/extractor/eitb.py
new file mode 100644
index 000000000..4ba323148
--- /dev/null
+++ b/youtube_dl/extractor/eitb.py
@@ -0,0 +1,37 @@
+# encoding: utf-8
+import re
+
+from .common import InfoExtractor
+from .brightcove import BrightcoveIE
+from ..utils import ExtractorError
+
+
+class EitbIE(InfoExtractor):
+    IE_NAME = u'eitb.tv'
+    _VALID_URL = r'https?://www\.eitb\.tv/(eu/bideoa|es/video)/[^/]+/(?P<playlist_id>\d+)/(?P<chapter_id>\d+)'
+
+    _TEST = {
+        u'add_ie': ['Brightcove'],
+        u'url': u'http://www.eitb.tv/es/video/60-minutos-60-minutos-2013-2014/2677100210001/2743577154001/lasa-y-zabala-30-anos/',
+        u'md5': u'edf4436247185adee3ea18ce64c47998',
+        u'info_dict': {
+            u'id': u'2743577154001',
+            u'ext': u'mp4',
+            u'title': u'60 minutos (Lasa y Zabala, 30 aƱos)',
+            # All videos from eitb has this description in the brightcove info
+            u'description': u'.',
+            u'uploader': u'Euskal Telebista',
+        },
+    }
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        chapter_id = mobj.group('chapter_id')
+        webpage = self._download_webpage(url, chapter_id)
+        bc_url = BrightcoveIE._extract_brightcove_url(webpage)
+        if bc_url is None:
+            raise ExtractorError(u'Could not extract the Brightcove url')
+        # The BrightcoveExperience object doesn't contain the video id, we set
+        # it manually
+        bc_url += '&%40videoPlayer={0}'.format(chapter_id)
+        return self.url_result(bc_url, BrightcoveIE.ie_key())