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.

35 lines
1.4 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from .brightcove import BrightcoveLegacyIE
  5. from ..compat import compat_parse_qs
  6. class TheStarIE(InfoExtractor):
  7. _VALID_URL = r'https?://(?:www\.)?thestar\.com/(?:[^/]+/)*(?P<id>.+)\.html'
  8. _TEST = {
  9. 'url': 'http://www.thestar.com/life/2016/02/01/mankind-why-this-woman-started-a-men-s-skincare-line.html',
  10. 'md5': '2c62dd4db2027e35579fefb97a8b6554',
  11. 'info_dict': {
  12. 'id': '4732393888001',
  13. 'ext': 'mp4',
  14. 'title': 'Mankind: Why this woman started a men\'s skin care line',
  15. 'description': 'Robert Cribb talks to Young Lee, the founder of Uncle Peter\'s MAN.',
  16. 'uploader_id': '794267642001',
  17. 'timestamp': 1454353482,
  18. 'upload_date': '20160201',
  19. },
  20. 'params': {
  21. # m3u8 download
  22. 'skip_download': True,
  23. }
  24. }
  25. BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/794267642001/default_default/index.html?videoId=%s'
  26. def _real_extract(self, url):
  27. display_id = self._match_id(url)
  28. webpage = self._download_webpage(url, display_id)
  29. brightcove_legacy_url = BrightcoveLegacyIE._extract_brightcove_url(webpage)
  30. brightcove_id = compat_parse_qs(brightcove_legacy_url)['@videoPlayer'][0]
  31. return self.url_result(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, 'BrightcoveNew', brightcove_id)