]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/spankbang.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..utils
import ExtractorError
9 class SpankBangIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:(?:www|[a-z]{2})\.)?spankbang\.com/(?P<id>[\da-z]+)/video'
12 'url': 'http://spankbang.com/3vvn/video/fantasy+solo',
13 'md5': '1cc433e1d6aa14bc376535b8679302f7',
17 'title': 'fantasy solo',
18 'description': 'Watch fantasy solo free HD porn video - 05 minutes - dillion harper masturbates on a bed free adult movies.',
19 'thumbnail': r
're:^https?://.*\.jpg$',
20 'uploader': 'silly2587',
25 'url': 'http://spankbang.com/1vt0/video/solvane+gangbang',
26 'only_matching': True,
29 'url': 'http://spankbang.com/lklg/video/sex+with+anyone+wedding+edition+2',
30 'only_matching': True,
33 def _real_extract(self
, url
):
34 video_id
= self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, video_id
)
37 if re
.search(r
'<[^>]+\bid=["\']video_removed
', webpage):
39 'Video
%s is not available
' % video_id, expected=True)
41 stream_key = self._html_search_regex(
42 r'''var\s+stream_key\s*=\s*['"](.+?)['"]''',
43 webpage, 'stream key')
46 'url': 'http://spankbang.com/_%s/%s/title/%sp__mp4' % (video_id, stream_key, height),
48 'format_id': '%sp' % height,
49 'height': int(height),
50 } for height in re.findall(r'<(?:span|li|p)[^>]+[qb]_(\d+)p', webpage)]
51 self._check_formats(formats, video_id)
52 self._sort_formats(formats)
54 title = self._html_search_regex(
55 r'(?s)<h1[^>]*>(.+?)</h1>', webpage, 'title')
56 description = self._og_search_description(webpage)
57 thumbnail = self._og_search_thumbnail(webpage)
58 uploader = self._search_regex(
59 r'class="user"[^>]*><img[^>]+>([^<]+)',
60 webpage, 'uploader', default=None)
62 age_limit = self._rta_search(webpage)
67 'description': description,
68 'thumbnail': thumbnail,
71 'age_limit': age_limit,