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 smuggle_url
  5. class SonyLIVIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?sonyliv\.com/details/[^/]+/(?P<id>\d+)'
  7. _TESTS = [{
  8. 'url': "http://www.sonyliv.com/details/episodes/5024612095001/Ep.-1---Achaari-Cheese-Toast---Bachelor's-Delight",
  9. 'info_dict': {
  10. 'title': "Ep. 1 - Achaari Cheese Toast - Bachelor's Delight",
  11. 'id': 'ref:5024612095001',
  12. 'ext': 'mp4',
  13. 'upload_date': '20170923',
  14. 'description': 'md5:7f28509a148d5be9d0782b4d5106410d',
  15. 'uploader_id': '5182475815001',
  16. 'timestamp': 1506200547,
  17. },
  18. 'params': {
  19. 'skip_download': True,
  20. },
  21. 'add_ie': ['BrightcoveNew'],
  22. }, {
  23. 'url': 'http://www.sonyliv.com/details/full%20movie/4951168986001/Sei-Raat-(Bangla)',
  24. 'only_matching': True,
  25. }]
  26. # BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/4338955589001/default_default/index.html?videoId=%s'
  27. BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/5182475815001/default_default/index.html?videoId=ref:%s'
  28. def _real_extract(self, url):
  29. brightcove_id = self._match_id(url)
  30. return self.url_result(
  31. smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, {
  32. 'geo_countries': ['IN'],
  33. 'referrer': url,
  34. }),
  35. 'BrightcoveNew', brightcove_id)