]> jfr.im git - yt-dlp.git/blame - youtube_dlc/extractor/sonyliv.py
Merge branch 'tvnow' of https://github.com/TinyToweringTree/youtube-dl into TinyTower...
[yt-dlp.git] / youtube_dlc / extractor / sonyliv.py
CommitLineData
8991844e
SS
1# coding: utf-8
2from __future__ import unicode_literals
3
4from .common import InfoExtractor
1bd4fc96 5from ..utils import smuggle_url
8991844e
SS
6
7
8class SonyLIVIE(InfoExtractor):
77426a08
S
9 _VALID_URL = r'https?://(?:www\.)?sonyliv\.com/details/[^/]+/(?P<id>\d+)'
10 _TESTS = [{
11 'url': "http://www.sonyliv.com/details/episodes/5024612095001/Ep.-1---Achaari-Cheese-Toast---Bachelor's-Delight",
8991844e 12 'info_dict': {
77426a08 13 'title': "Ep. 1 - Achaari Cheese Toast - Bachelor's Delight",
1bd4fc96 14 'id': 'ref:5024612095001',
8991844e 15 'ext': 'mp4',
1bd4fc96 16 'upload_date': '20170923',
77426a08 17 'description': 'md5:7f28509a148d5be9d0782b4d5106410d',
1bd4fc96
RA
18 'uploader_id': '5182475815001',
19 'timestamp': 1506200547,
8991844e
SS
20 },
21 'params': {
22 'skip_download': True,
23 },
24 'add_ie': ['BrightcoveNew'],
77426a08
S
25 }, {
26 'url': 'http://www.sonyliv.com/details/full%20movie/4951168986001/Sei-Raat-(Bangla)',
27 'only_matching': True,
28 }]
29
1bd4fc96
RA
30 # BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/4338955589001/default_default/index.html?videoId=%s'
31 BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/5182475815001/default_default/index.html?videoId=ref:%s'
8991844e
SS
32
33 def _real_extract(self, url):
77426a08
S
34 brightcove_id = self._match_id(url)
35 return self.url_result(
90830004
S
36 smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id, {
37 'geo_countries': ['IN'],
38 'referrer': url,
39 }),
1bd4fc96 40 'BrightcoveNew', brightcove_id)