add multi video

This commit is contained in:
huangtiande 2016-01-18 11:33:20 +08:00
parent cd4f624a8a
commit 86c7cdc37f

View File

@ -50,17 +50,29 @@ class IfengIE(InfoExtractor):
title = info_doc.find('./item').get('Name') title = info_doc.find('./item').get('Name')
entry = {
'id': '{0}'.format(video_id),
'title': title,
'formats': []
}
for element in info_doc.findall('./videos/video'): for element in info_doc.findall('./videos/video'):
if element.get('mediaType') != 'mp4': if element.get('mediaType') != 'mp4':
continue continue
url = element.get('VideoPlayUrl') quality = -1
if element.get('type') == '500k': if element.get('type') == '500k':
break quality = 0
entry['formats'].append({
'url': element.get('VideoPlayUrl'),
'ext': 'mp4',
'quality' : quality
})
return { return {
'id': video_id, 'id': video_id,
'title': title, 'title': title,
'url': url, '_type': 'multi_video',
'ext': 'mp4', 'entries': [entry],
} }