mirror of
https://github.com/l1ving/youtube-dl
synced 2024-11-22 14:42:56 +08:00
[moviefap] Explicitly sort formats to handle possible site changes
This commit is contained in:
parent
b971abe897
commit
8a1b49ff19
@ -111,11 +111,14 @@ class MovieFapIE(InfoExtractor):
|
|||||||
# multiple formats available
|
# multiple formats available
|
||||||
info['formats'] = []
|
info['formats'] = []
|
||||||
|
|
||||||
# N.B. formats are already in ascending order of quality
|
|
||||||
for item in xml.find('quality').findall('item'):
|
for item in xml.find('quality').findall('item'):
|
||||||
|
resolution = xpath_text(item, 'res', 'resolution', True) # 480p etc.
|
||||||
info['formats'].append({
|
info['formats'].append({
|
||||||
'url': xpath_text(item, 'videoLink', 'url', True),
|
'url': xpath_text(item, 'videoLink', 'url', True),
|
||||||
'resolution': xpath_text(item, 'res', 'resolution', True) # 480p etc.
|
'resolution': resolution,
|
||||||
|
'height': int(re.findall(r'\d+', resolution)[0])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
self._sort_formats(info['formats'])
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
Loading…
Reference in New Issue
Block a user