1 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class SpankBangIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:(?:www|[a-z]{2})\.)?spankbang\.com/(?P<id>[\da-z]+)/video'
11 'url': 'http://spankbang.com/3vvn/video/fantasy+solo',
12 'md5': '1cc433e1d6aa14bc376535b8679302f7',
16 'title': 'fantasy solo',
17 'description': 'dillion harper masturbates on a bed',
18 'thumbnail': 're:^https?://.*\.jpg$',
19 'uploader': 'silly2587',
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
26 webpage = self._download_webpage(url, video_id)
28 stream_key = self._html_search_regex(
29 r'''var\s+stream_key\s*=\s*['"](.+?)['"]''',
30 webpage, 'stream key')
33 'url': 'http://spankbang.com/_%s/%s/title/%sp__mp4' % (video_id, stream_key, height),
35 'format_id': '%sp' % height,
36 'height': int(height),
37 } for height in re.findall(r'<(?:span|li)[^>]+q_(\d+)p', webpage)]
38 self._sort_formats(formats)
40 title = self._html_search_regex(
41 r'(?s)<h1[^>]*>(.+?)</h1>', webpage, 'title')
42 description = self._search_regex(
43 r'class="desc"[^>]*>([^<]+)',
44 webpage, 'description', default=None)
45 thumbnail = self._og_search_thumbnail(webpage)
46 uploader = self._search_regex(
47 r'class="user"[^>]*>([^<]+)',
48 webpage, 'uploader', fatal=False)
50 age_limit = self._rta_search(webpage)
55 'description': description,
56 'thumbnail': thumbnail,
59 'age_limit': age_limit,