- stream_key = self._html_search_regex(
- r'''var\s+stream_key\s*=\s*['"](.+?)['"]''',
- webpage, 'stream key')
-
- formats = [{
- 'url': 'http://spankbang.com/_%s/%s/title/%sp__mp4' % (video_id, stream_key, height),
- 'ext': 'mp4',
- 'format_id': '%sp' % height,
- 'height': int(height),
- } for height in re.findall(r'<(?:span|li|p)[^>]+[qb]_(\d+)p', webpage)]
- self._check_formats(formats, video_id)
+ formats = []
+ for mobj in re.finditer(
+ r'stream_url_(?P<id>[^\s=]+)\s*=\s*(["\'])(?P<url>(?:(?!\2).)+)\2',
+ webpage):
+ format_id, format_url = mobj.group('id', 'url')
+ f = parse_resolution(format_id)
+ f.update({
+ 'url': format_url,
+ 'format_id': format_id,
+ })
+ formats.append(f)