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.

39 lines
1.4 KiB

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