1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-27 14:05:17 +08:00
This commit is contained in:
Leo Lam 2016-04-17 18:13:56 -04:00
parent 4fdf082375
commit 6a72c82d95

View File

@ -107,15 +107,12 @@ class RaiTVIE(InfoExtractor):
return xml.replace(' tag elementi', '').replace('>/', '</') return xml.replace(' tag elementi', '').replace('>/', '</')
relinker = self._download_xml( relinker = self._download_xml(
media['mediaUri'] + '&output=43', media['mediaUri'] + '&output=44',
video_id, transform_source=fix_xml) video_id, transform_source=fix_xml)
has_subtitle = False has_subtitle = False
media_url = relinker.findtext('url')
for element in relinker.findall('element'):
media_url = xpath_text(element, 'url')
ext = determine_ext(media_url) ext = determine_ext(media_url)
content_type = xpath_text(element, 'content-type') content_type = relinker.findtext('ct')
if ext == 'm3u8': if ext == 'm3u8':
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
media_url, video_id, 'mp4', 'm3u8_native', media_url, video_id, 'mp4', 'm3u8_native',
@ -127,7 +124,7 @@ class RaiTVIE(InfoExtractor):
elif ext == 'stl': elif ext == 'stl':
has_subtitle = True has_subtitle = True
elif content_type.startswith('video/'): elif content_type.startswith('video/'):
bitrate = int_or_none(xpath_text(element, 'bitrate')) bitrate = int_or_none(relinker.findtext('bitrate'))
formats.append({ formats.append({
'url': media_url, 'url': media_url,
'tbr': bitrate if bitrate > 0 else None, 'tbr': bitrate if bitrate > 0 else None,