- # Get the video title
- video_title = self._html_search_regex(r'name="title" value="(?P<title>[^"]*)"',
- webpage, u'title').strip()
-
- cfg_url = self._html_search_regex(r'flashvars\.config = escape\("([^"]+)"',
- webpage, u'flashvars.config').strip()
-
- cfg_xml = self._download_xml(cfg_url, video_id, note=u'Downloading metadata')
- video_url = cfg_xml.find('videoLink').text
-
- info = {'id': video_id,
- 'url': video_url,
- 'title': video_title,
- 'ext': 'flv',
- 'age_limit': age_limit}
-
- return [info]
+ video_title = self._html_search_regex(
+ r'name="title" value="(?P<title>[^"]*)"', webpage, 'title')
+ video_description = self._html_search_regex(
+ r'name="description" value="([^"]*)"', webpage, 'description', fatal=False)
+
+ cfg_url = self._html_search_regex(
+ r'flashvars\.config = escape\("([^"]+)"',
+ webpage, 'flashvars.config')
+
+ cfg_xml = self._download_xml(
+ cfg_url, video_id, note='Downloading metadata')
+
+ formats = [
+ {
+ 'url': item.find('videoLink').text,
+ 'format_id': item.find('res').text,
+ } for item in cfg_xml.findall('./quality/item')
+ ]
+
+ return {
+ 'id': video_id,
+ 'title': video_title,
+ 'description': video_description,
+ 'formats': formats,
+ 'age_limit': age_limit,
+ }