mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 10:24:33 +01:00
[limelight] Improve and make more robust (closes #11737)
+ Add support for direct http for videos hosted on video.llnw.net * Check handmade http URLs
This commit is contained in:
parent
16e2c8f771
commit
906420cae3
@ -59,14 +59,26 @@ class LimelightBaseIE(InfoExtractor):
|
|||||||
format_id = 'rtmp'
|
format_id = 'rtmp'
|
||||||
if stream.get('videoBitRate'):
|
if stream.get('videoBitRate'):
|
||||||
format_id += '-%d' % int_or_none(stream['videoBitRate'])
|
format_id += '-%d' % int_or_none(stream['videoBitRate'])
|
||||||
http_url = 'http://cpl.delvenetworks.com/' + rtmp.group('playpath')[4:]
|
http_format_id = format_id.replace('rtmp', 'http')
|
||||||
|
|
||||||
|
CDN_HOSTS = (
|
||||||
|
('delvenetworks.com', 'cpl.delvenetworks.com'),
|
||||||
|
('video.llnw.net', 's2.content.video.llnw.net'),
|
||||||
|
)
|
||||||
|
for cdn_host, http_host in CDN_HOSTS:
|
||||||
|
if cdn_host not in rtmp.group('host').lower():
|
||||||
|
continue
|
||||||
|
http_url = 'http://%s/%s' % (http_host, rtmp.group('playpath')[4:])
|
||||||
urls.append(http_url)
|
urls.append(http_url)
|
||||||
|
if self._is_valid_url(http_url, video_id, http_format_id):
|
||||||
http_fmt = fmt.copy()
|
http_fmt = fmt.copy()
|
||||||
http_fmt.update({
|
http_fmt.update({
|
||||||
'url': http_url,
|
'url': http_url,
|
||||||
'format_id': format_id.replace('rtmp', 'http'),
|
'format_id': http_format_id,
|
||||||
})
|
})
|
||||||
formats.append(http_fmt)
|
formats.append(http_fmt)
|
||||||
|
break
|
||||||
|
|
||||||
fmt.update({
|
fmt.update({
|
||||||
'url': rtmp.group('url'),
|
'url': rtmp.group('url'),
|
||||||
'play_path': rtmp.group('playpath'),
|
'play_path': rtmp.group('playpath'),
|
||||||
|
Loading…
Reference in New Issue
Block a user