X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fhotstar.py;h=f05d765d650f540abe7f684037cc957ff2ab0b77;hb=05bddcc512cd5058f1af1d5985979b70bdcf4711;hp=05d27e75de818f135ae1f55195723acaaf489101;hpb=9f0ee2a3883ec6f6fdccba90085cb925aaa2f617;p=youtube-dl diff --git a/youtube_dl/extractor/hotstar.py b/youtube_dl/extractor/hotstar.py index 05d27e75d..f05d765d6 100644 --- a/youtube_dl/extractor/hotstar.py +++ b/youtube_dl/extractor/hotstar.py @@ -10,8 +10,8 @@ from ..utils import ( class HotStarIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?hotstar\.com/.*?[/-](?P\d{10})' - _TEST = { + _VALID_URL = r'https?://(?:www\.)?hotstar\.com/(?:.+?[/-])?(?P\d{10})' + _TESTS = [{ 'url': 'http://www.hotstar.com/on-air-with-aib--english-1000076273', 'info_dict': { 'id': '1000076273', @@ -26,7 +26,13 @@ class HotStarIE(InfoExtractor): # m3u8 download 'skip_download': True, } - } + }, { + 'url': 'http://www.hotstar.com/sports/cricket/rajitha-sizzles-on-debut-with-329/2001477583', + 'only_matching': True, + }, { + 'url': 'http://www.hotstar.com/1000000515', + 'only_matching': True, + }] _GET_CONTENT_TEMPLATE = 'http://account.hotstar.com/AVS/besc?action=GetAggregatedContentDetails&channel=PCTV&contentId=%s' _GET_CDN_TEMPLATE = 'http://getcdn.hotstar.com/AVS/besc?action=GetCDN&asJson=Y&channel=%s&id=%s&type=%s' @@ -55,9 +61,7 @@ class HotStarIE(InfoExtractor): format_url = format_data['src'] ext = determine_ext(format_url) if ext == 'm3u8': - m3u8_formats = self._extract_m3u8_formats(format_url, video_id, 'mp4', m3u8_id='hls', fatal=False) - if m3u8_formats: - formats.extend(m3u8_formats) + formats.extend(self._extract_m3u8_formats(format_url, video_id, 'mp4', m3u8_id='hls', fatal=False)) elif ext == 'f4m': # produce broken files continue