1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-25 11:41:52 +00:00
youtube-dl/youtube_dl/extractor/sonyliv.py

38 lines
1.4 KiB
Python
Raw Normal View History

2016-08-07 23:11:00 +00:00
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import smuggle_url
2016-08-07 23:11:00 +00:00
class SonyLIVIE(InfoExtractor):
2016-08-08 19:16:28 +00:00
_VALID_URL = r'https?://(?:www\.)?sonyliv\.com/details/[^/]+/(?P<id>\d+)'
_TESTS = [{
'url': "http://www.sonyliv.com/details/episodes/5024612095001/Ep.-1---Achaari-Cheese-Toast---Bachelor's-Delight",
2016-08-07 23:11:00 +00:00
'info_dict': {
2016-08-08 19:16:28 +00:00
'title': "Ep. 1 - Achaari Cheese Toast - Bachelor's Delight",
'id': 'ref:5024612095001',
2016-08-07 23:11:00 +00:00
'ext': 'mp4',
'upload_date': '20170923',
2016-08-08 19:16:28 +00:00
'description': 'md5:7f28509a148d5be9d0782b4d5106410d',
'uploader_id': '5182475815001',
'timestamp': 1506200547,
2016-08-07 23:11:00 +00:00
},
'params': {
'skip_download': True,
},
'add_ie': ['BrightcoveNew'],
2016-08-08 19:16:28 +00:00
}, {
'url': 'http://www.sonyliv.com/details/full%20movie/4951168986001/Sei-Raat-(Bangla)',
'only_matching': True,
}]
# BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/4338955589001/default_default/index.html?videoId=%s'
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/5182475815001/default_default/index.html?videoId=ref:%s'
2016-08-07 23:11:00 +00:00
def _real_extract(self, url):
2016-08-08 19:16:28 +00:00
brightcove_id = self._match_id(url)
return self.url_result(
smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, {'geo_countries': ['IN']}),
'BrightcoveNew', brightcove_id)