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. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..utils import unescapeHTML
  5. class VODPlatformIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?vod-platform\.net/[eE]mbed/(?P<id>[^/?#]+)'
  7. _TEST = {
  8. # from http://www.lbcgroup.tv/watch/chapter/29143/52844/%D8%A7%D9%84%D9%86%D8%B5%D8%B1%D8%A9-%D9%81%D9%8A-%D8%B6%D9%8A%D8%A7%D9%81%D8%A9-%D8%A7%D9%84%D9%80-cnn/ar
  9. 'url': 'http://vod-platform.net/embed/RufMcytHDolTH1MuKHY9Fw',
  10. 'md5': '1db2b7249ce383d6be96499006e951fc',
  11. 'info_dict': {
  12. 'id': 'RufMcytHDolTH1MuKHY9Fw',
  13. 'ext': 'mp4',
  14. 'title': 'LBCi News_ النصرة في ضيافة الـ "سي.أن.أن"',
  15. }
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. title = unescapeHTML(self._og_search_title(webpage))
  21. hidden_inputs = self._hidden_inputs(webpage)
  22. formats = self._extract_wowza_formats(
  23. hidden_inputs.get('HiddenmyhHlsLink') or hidden_inputs['HiddenmyDashLink'], video_id, skip_protocols=['f4m', 'smil'])
  24. self._sort_formats(formats)
  25. return {
  26. 'id': video_id,
  27. 'title': title,
  28. 'thumbnail': hidden_inputs.get('HiddenThumbnail') or self._og_search_thumbnail(webpage),
  29. 'formats': formats,
  30. }