'uploader_id': '15973816',
'uploader': '阿能',
'timestamp': 1314932940,
- 'title': '孤單南半球-歐德陽'
+ 'title': '孤單南半球-歐德陽',
+ 'thumbnail': 're:^https?://.*\.jpg$',
+ 'categories': ['個人短片'],
+ 'duration': 247.246
}
}, {
# Audio with alternative form of url
'uploader': '蠍',
'timestamp': 1293367080,
'title': '孫燕姿-眼淚成詩',
+ 'thumbnail': 're:^https?://.*\.jpg$',
+ 'categories': ['個人短片'],
+ 'duration': 223.19
}
}, {
# Video with only one format
'uploader': 'Valen',
'timestamp': 1299383640,
'title': '孫燕姿 - 眼淚成詩',
+ 'thumbnail': 're:^https?://.*\.jpg$',
+ 'categories': ['影視娛樂'],
+ 'duration': 217.399
}
}, {
# Video with two formats
'uploader': '我只是想認真點',
'timestamp': 1421481240,
'title': '暗殺教室 02',
+ 'thumbnail': 're:^https?://.*\.jpg$',
+ 'categories': ['電玩動漫'],
+ 'duration': 1384.907
}
}]
}
if 'hq_src' in flv_config:
- src = flv_config['src']
- src_hq = flv_config['hq_src']
- ret_attrs['formats'] = [{
- 'url': src,
- 'ext': self._guess_ext(src),
- 'format_id': self._type_string(src)
- }, {
- 'url': src_hq,
- 'ext': self._guess_ext(src_hq),
- 'format_id': self._type_string(src_hq)
- }]
+ urls = [flv_config['src'], flv_config['hq_src']]
+
+ ret_attrs['formats'] = []
+
+ for url in urls:
+ ret_attrs['formats'].append({
+ 'url': url,
+ 'ext': self._guess_ext(url),
+ 'format_id': self._type_string(url),
+ 'height': int(self._type_string(url))
+ })
else:
ret_attrs['url'] = flv_config['src']
ret_attrs['ext'] = self._guess_ext(flv_config['src'])