[sonyliv] Add new extractor
[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'http?://(?:www\.)?sonyliv\.com/details/episodes/(?P<id>[0-9]+)/'
9     _TEST = {
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': 'Bachelor\'s Delight is a new food show from Sony LIV to satisfy the taste buds of all those bachelors looking for a quick bite.',
17             'uploader_id': '4338955589001',
18             'timestamp': 1467870968,
19         },
20         'params': {
21             'skip_download': True,
22         },
23         'add_ie': ['BrightcoveNew'],
24     }
25     BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/4338955589001/default_default/index.html?videoId=%s'
26
27     def _real_extract(self, url):
28         return self.url_result(self.BRIGHTCOVE_URL_TEMPLATE % self._match_id(url), 'BrightcoveNew')