- video_url = self._search_regex(r"var normal_video_file = '(.*?)';",
- webpage, u'video file URL')
+ FORMATS = ('normal', 'hq')
+ quality = qualities(FORMATS)
+ formats = []
+ for format_id in FORMATS:
+ rex = r"var %s_video_file = '(.*?)';" % re.escape(format_id)
+ video_url = self._search_regex(rex, webpage, 'video file URLx',
+ fatal=False)
+ if not video_url:
+ continue
+ formats.append({
+ 'format_id': format_id,
+ 'url': video_url,
+ 'quality': quality(format_id),
+ })
+ self._sort_formats(formats)