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.

33 lines
1.2 KiB

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