1 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class BeegIE(InfoExtractor):
9 _VALID_URL = r'https?://(?:www\.)?beeg\.com/(?P<id>\d+)'
11 'url': 'http://beeg.com/5416503',
12 'md5': '634526ae978711f6b748fe0dd6c11f57',
16 'title': 'Sultry Striptease',
17 'description': 'md5:6db3c6177972822aaba18652ff59c773',
18 'categories': list, # NSFW
19 'thumbnail': 're:https?://.*\.jpg$',
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
25 video_id = mobj.group('id')
27 webpage = self._download_webpage(url, video_id)
29 video_url = self._html_search_regex(
30 r"'480p'\s*:\s*'([^']+)'", webpage, 'video URL')
32 title = self._html_search_regex(
33 r'<title>([^<]+)\s*-\s*beeg\.?</title>', webpage, 'title')
35 description = self._html_search_regex(
36 r'<meta name="description" content="([^"]*)"',
37 webpage, 'description', fatal=False)
38 thumbnail = self._html_search_regex(
39 r'\'previewer.url\'\s*:\s*"([^"]*)"',
40 webpage, 'thumbnail', fatal=False)
42 categories_str = self._html_search_regex(
43 r'<meta name="keywords" content="([^"]+)"', webpage, 'categories', fatal=False)
44 categories = categories_str.split(',')
50 'description': description,
51 'thumbnail': thumbnail,
52 'categories': categories,