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.

34 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class SonyLIVIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?sonyliv\.com/details/[^/]+/(?P<id>\d+)'
  6. _TESTS = [{
  7. 'url': "http://www.sonyliv.com/details/episodes/5024612095001/Ep.-1---Achaari-Cheese-Toast---Bachelor's-Delight",
  8. 'info_dict': {
  9. 'title': "Ep. 1 - Achaari Cheese Toast - Bachelor's Delight",
  10. 'id': '5024612095001',
  11. 'ext': 'mp4',
  12. 'upload_date': '20160707',
  13. 'description': 'md5:7f28509a148d5be9d0782b4d5106410d',
  14. 'uploader_id': '4338955589001',
  15. 'timestamp': 1467870968,
  16. },
  17. 'params': {
  18. 'skip_download': True,
  19. },
  20. 'add_ie': ['BrightcoveNew'],
  21. }, {
  22. 'url': 'http://www.sonyliv.com/details/full%20movie/4951168986001/Sei-Raat-(Bangla)',
  23. 'only_matching': True,
  24. }]
  25. BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/4338955589001/default_default/index.html?videoId=%s'
  26. def _real_extract(self, url):
  27. brightcove_id = self._match_id(url)
  28. return self.url_result(
  29. self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, 'BrightcoveNew', brightcove_id)