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.

36 lines
1.3 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class AlJazeeraIE(InfoExtractor):
  4. _VALID_URL = r'http://www\.aljazeera\.com/programmes/.*?/(?P<id>[^/]+)\.html'
  5. _TEST = {
  6. 'url': 'http://www.aljazeera.com/programmes/the-slum/2014/08/deliverance-201482883754237240.html',
  7. 'info_dict': {
  8. 'id': '3792260579001',
  9. 'ext': 'mp4',
  10. 'title': 'The Slum - Episode 1: Deliverance',
  11. 'description': 'As a birth attendant advocating for family planning, Remy is on the frontline of Tondo\'s battle with overcrowding.',
  12. 'uploader': 'Al Jazeera English',
  13. },
  14. 'add_ie': ['BrightcoveLegacy'],
  15. 'skip': 'Not accessible from Travis CI server',
  16. }
  17. def _real_extract(self, url):
  18. program_name = self._match_id(url)
  19. webpage = self._download_webpage(url, program_name)
  20. brightcove_id = self._search_regex(
  21. r'RenderPagesVideo\(\'(.+?)\'', webpage, 'brightcove id')
  22. return {
  23. '_type': 'url',
  24. 'url': (
  25. 'brightcove:'
  26. 'playerKey=AQ~~%2CAAAAmtVJIFk~%2CTVGOQ5ZTwJbeMWnq5d_H4MOM57xfzApc'
  27. '&%40videoPlayer={0}'.format(brightcove_id)
  28. ),
  29. 'ie_key': 'BrightcoveLegacy',
  30. }