You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.4 KiB

  1. # encoding: utf-8
  2. import re
  3. from .common import InfoExtractor
  4. from .brightcove import BrightcoveIE
  5. from ..utils import ExtractorError
  6. class EitbIE(InfoExtractor):
  7. IE_NAME = u'eitb.tv'
  8. _VALID_URL = r'https?://www\.eitb\.tv/(eu/bideoa|es/video)/[^/]+/(?P<playlist_id>\d+)/(?P<chapter_id>\d+)'
  9. _TEST = {
  10. u'add_ie': ['Brightcove'],
  11. u'url': u'http://www.eitb.tv/es/video/60-minutos-60-minutos-2013-2014/2677100210001/2743577154001/lasa-y-zabala-30-anos/',
  12. u'md5': u'edf4436247185adee3ea18ce64c47998',
  13. u'info_dict': {
  14. u'id': u'2743577154001',
  15. u'ext': u'mp4',
  16. u'title': u'60 minutos (Lasa y Zabala, 30 años)',
  17. # All videos from eitb has this description in the brightcove info
  18. u'description': u'.',
  19. u'uploader': u'Euskal Telebista',
  20. },
  21. }
  22. def _real_extract(self, url):
  23. mobj = re.match(self._VALID_URL, url)
  24. chapter_id = mobj.group('chapter_id')
  25. webpage = self._download_webpage(url, chapter_id)
  26. bc_url = BrightcoveIE._extract_brightcove_url(webpage)
  27. if bc_url is None:
  28. raise ExtractorError(u'Could not extract the Brightcove url')
  29. # The BrightcoveExperience object doesn't contain the video id, we set
  30. # it manually
  31. bc_url += '&%40videoPlayer={0}'.format(chapter_id)
  32. return self.url_result(bc_url, BrightcoveIE.ie_key())