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