[radiocanada] fix extraction for toutv rtmp formats

This commit is contained in:
Remita Amine 2017-02-04 17:02:12 +01:00
parent 31487eb974
commit 8e4041cf3f
1 changed files with 10 additions and 4 deletions

View File

@ -54,9 +54,8 @@ class RadioCanadaIE(InfoExtractor):
raise ExtractorError('This video is DRM protected.', expected=True) raise ExtractorError('This video is DRM protected.', expected=True)
device_types = ['ipad'] device_types = ['ipad']
if app_code != 'toutv':
device_types.append('flash')
if not smuggled_data: if not smuggled_data:
device_types.append('flash')
device_types.append('android') device_types.append('android')
formats = [] formats = []
@ -103,7 +102,7 @@ class RadioCanadaIE(InfoExtractor):
continue continue
f_url = re.sub(r'\d+\.%s' % ext, '%d.%s' % (tbr, ext), v_url) f_url = re.sub(r'\d+\.%s' % ext, '%d.%s' % (tbr, ext), v_url)
protocol = determine_protocol({'url': f_url}) protocol = determine_protocol({'url': f_url})
formats.append({ f = {
'format_id': '%s-%d' % (protocol, tbr), 'format_id': '%s-%d' % (protocol, tbr),
'url': f_url, 'url': f_url,
'ext': 'flv' if protocol == 'rtmp' else ext, 'ext': 'flv' if protocol == 'rtmp' else ext,
@ -111,7 +110,14 @@ class RadioCanadaIE(InfoExtractor):
'width': int_or_none(url_e.get('width')), 'width': int_or_none(url_e.get('width')),
'height': int_or_none(url_e.get('height')), 'height': int_or_none(url_e.get('height')),
'tbr': tbr, 'tbr': tbr,
}) }
mobj = re.match(r'(?P<url>rtmp://[^/]+/[^/]+)/(?P<playpath>[^?]+)(?P<auth>\?.+)', f_url)
if mobj:
f.update({
'url': mobj.group('url') + mobj.group('auth'),
'play_path': mobj.group('playpath'),
})
formats.append(f)
if protocol == 'rtsp': if protocol == 'rtsp':
base_url = self._search_regex( base_url = self._search_regex(
r'rtsp://([^?]+)', f_url, 'base url', default=None) r'rtsp://([^?]+)', f_url, 'base url', default=None)