1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-23 17:04:33 +01:00

IOL RTMP support

This commit is contained in:
PC 2015-10-10 19:16:41 +01:00
parent 7eabb134fc
commit c82b7ac8b0

View File

@ -64,14 +64,26 @@ class IOLIE(InfoExtractor):
formats_m3u8_default = self._extract_m3u8_formats(m3u8_url_default, video_id, ext='mp4') formats_m3u8_default = self._extract_m3u8_formats(m3u8_url_default, video_id, ext='mp4')
formats.extend(formats_m3u8_default) formats.extend(formats_m3u8_default)
server = 'video2.iol.pt' # try rtmp format
if self._html_search_regex(r'<script\s+src\s*=\s*"([^"]*/cdn\.iol\.pt/js/iol\.js)"', webpage, "iol.js", fatal=False):
server = 'video1.iol.pt'
try:
# get actual server
xml = self._download_xml('http://www.iol.pt/videolb', video_id, note='Downloading server info XML', fatal=False)
if 'redirect' == xml.tag:
server = xml.text
except Exception as ex:
# just ignore every error, rtmp is not essential
self.report_warning('RTMP server not found. %r' % (ex,))
formats.append({ formats.append({
'url': 'rtmp://' + server + '/vod', 'url': 'rtmp://' + server + '/vod',
'play_path': 'mp4:' + multimedia_id + '-L-500k', 'play_path': 'mp4:' + multimedia_id + '-L-500k',
'format_id': 'rtmp-500', 'format_id': 'rtmp-500',
'tbr': 500, 'tbr': 500,
'protocol': 'rtmp', 'protocol': 'rtmp'
'ext': 'mp4'
}) })
formats.append({ formats.append({