mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-26 10:24:33 +01:00
[videolecturesnet] Check http format URLs (Closes #4968)
This commit is contained in:
parent
4069766c52
commit
0d93378887
@ -49,15 +49,30 @@ class VideoLecturesNetIE(InfoExtractor):
|
|||||||
thumbnail = (
|
thumbnail = (
|
||||||
None if thumbnail_el is None else thumbnail_el.attrib.get('src'))
|
None if thumbnail_el is None else thumbnail_el.attrib.get('src'))
|
||||||
|
|
||||||
formats = [{
|
formats = []
|
||||||
'url': v.attrib['src'],
|
for v in switch.findall('./video'):
|
||||||
|
proto = v.attrib.get('proto')
|
||||||
|
if not proto in ['http', 'rtmp']:
|
||||||
|
continue
|
||||||
|
f = {
|
||||||
'width': int_or_none(v.attrib.get('width')),
|
'width': int_or_none(v.attrib.get('width')),
|
||||||
'height': int_or_none(v.attrib.get('height')),
|
'height': int_or_none(v.attrib.get('height')),
|
||||||
'filesize': int_or_none(v.attrib.get('size')),
|
'filesize': int_or_none(v.attrib.get('size')),
|
||||||
'tbr': int_or_none(v.attrib.get('systemBitrate')) / 1000.0,
|
'tbr': int_or_none(v.attrib.get('systemBitrate')) / 1000.0,
|
||||||
'ext': v.attrib.get('ext'),
|
'ext': v.attrib.get('ext'),
|
||||||
} for v in switch.findall('./video')
|
}
|
||||||
if v.attrib.get('proto') == 'http']
|
src = v.attrib['src']
|
||||||
|
if proto == 'http':
|
||||||
|
if self._is_valid_url(src, video_id):
|
||||||
|
f['url'] = src
|
||||||
|
formats.append(f)
|
||||||
|
elif proto == 'rtmp':
|
||||||
|
f.update({
|
||||||
|
'url': v.attrib['streamer'],
|
||||||
|
'play_path': src,
|
||||||
|
})
|
||||||
|
formats.append(f)
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user