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.

40 lines
1.5 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|embed\.kwikmotion\.com)/[eE]mbed/(?P<id>[^/?#]+)'
  7. _TESTS = [{
  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. 'url': 'http://embed.kwikmotion.com/embed/RufMcytHDolTH1MuKHY9Fw',
  18. 'only_matching': True,
  19. }]
  20. def _real_extract(self, url):
  21. video_id = self._match_id(url)
  22. webpage = self._download_webpage(url, video_id)
  23. title = unescapeHTML(self._og_search_title(webpage))
  24. hidden_inputs = self._hidden_inputs(webpage)
  25. formats = self._extract_wowza_formats(
  26. hidden_inputs.get('HiddenmyhHlsLink') or hidden_inputs['HiddenmyDashLink'], video_id, skip_protocols=['f4m', 'smil'])
  27. self._sort_formats(formats)
  28. return {
  29. 'id': video_id,
  30. 'title': title,
  31. 'thumbnail': hidden_inputs.get('HiddenThumbnail') or self._og_search_thumbnail(webpage),
  32. 'formats': formats,
  33. }