- title = data['metadata']['title'][0]
- description = data['metadata']['description'][0]
- uploader = data['metadata']['creator'][0]
- upload_date = unified_strdate(data['metadata']['date'][0])
-
- formats = [{
- 'format': fdata['format'],
- 'url': 'http://' + data['server'] + data['dir'] + fn,
- 'file_size': int(fdata['size']),
- }
- for fn,fdata in data['files'].items()
- if 'Video' in fdata['format']]
- formats.sort(key=lambda fdata: fdata['file_size'])
- for f in formats:
- f['ext'] = determine_ext(f['url'])
-
- return {
- '_type': 'video',
- 'id': video_id,
- 'title': title,
- 'formats': formats,
- 'description': description,
- 'uploader': uploader,
- 'upload_date': upload_date,
- 'thumbnail': data.get('misc', {}).get('image'),
- }
+ metadata = self._download_json(
+ 'http://archive.org/details/' + video_id, video_id, query={
+ 'output': 'json',
+ })['metadata']
+ info.update({
+ 'title': get_optional(metadata, 'title') or info.get('title'),
+ 'description': clean_html(get_optional(metadata, 'description')),
+ })
+ if info.get('_type') != 'playlist':
+ info.update({
+ 'uploader': get_optional(metadata, 'creator'),
+ 'upload_date': unified_strdate(get_optional(metadata, 'date')),
+ })
+ return info