- return [{
- 'id': video_id,
- 'url': info['mediaURI'],
- 'ext': 'flv',
- 'title': info['title'],
- 'thumbnail': info['screenshotURI'],
- 'description': info['description'],
- 'uploader': info['user'],
- 'view_count': info['numberOfViews'],
- 'upload_date': u'%04i%02i%02i' % (date.tm_year, date.tm_mon, date.tm_mday),
- }]
+ info = self._download_json(
+ 'https://dotsub.com/api/media/%s/metadata' % video_id, video_id)
+ video_url = info.get('mediaURI')
+
+ if not video_url:
+ webpage = self._download_webpage(url, video_id)
+ video_url = self._search_regex(
+ [r'<source[^>]+src="([^"]+)"', r'"file"\s*:\s*\'([^\']+)'],
+ webpage, 'video url')
+
+ return {
+ 'id': video_id,
+ 'url': video_url,
+ 'ext': 'flv',
+ 'title': info['title'],
+ 'description': info.get('description'),
+ 'thumbnail': info.get('screenshotURI'),
+ 'duration': int_or_none(info.get('duration'), 1000),
+ 'uploader': info.get('user'),
+ 'timestamp': float_or_none(info.get('dateCreated'), 1000),
+ 'view_count': int_or_none(info.get('numberOfViews')),
+ }