mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-23 08:54:33 +01:00
IOL RTMP support
This commit is contained in:
parent
7eabb134fc
commit
c82b7ac8b0
@ -64,14 +64,26 @@ class IOLIE(InfoExtractor):
|
||||
formats_m3u8_default = self._extract_m3u8_formats(m3u8_url_default, video_id, ext='mp4')
|
||||
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({
|
||||
'url': 'rtmp://'+server+'/vod',
|
||||
'url': 'rtmp://' + server + '/vod',
|
||||
'play_path': 'mp4:' + multimedia_id + '-L-500k',
|
||||
'format_id': 'rtmp-500',
|
||||
'tbr': 500,
|
||||
'protocol': 'rtmp',
|
||||
'ext': 'mp4'
|
||||
'protocol': 'rtmp'
|
||||
})
|
||||
|
||||
formats.append({
|
||||
|
Loading…
Reference in New Issue
Block a user