- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
-
- json_url = url + (u'?' if u'?' in url else '&') + u'output=json'
- json_data = self._download_webpage(json_url, video_id)
- data = json.loads(json_data)
-
- 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'])
-
- info = {
- '_type': 'video',
- 'id': video_id,
- 'title': title,
- 'formats': formats,
- 'description': description,
- 'uploader': uploader,
- 'upload_date': upload_date,
- }
- thumbnail = data.get('misc', {}).get('image')
- if thumbnail:
- info['thumbnail'] = thumbnail
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(
+ 'http://archive.org/embed/' + video_id, video_id)
+ jwplayer_playlist = self._parse_json(self._search_regex(
+ r"(?s)Play\('[^']+'\s*,\s*(\[.+\])\s*,\s*{.*?}\);",
+ webpage, 'jwplayer playlist'), video_id)
+ info = self._parse_jwplayer_data(
+ {'playlist': jwplayer_playlist}, video_id, base_url=url)