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$',
24 def _real_extract(self, url):
25 mobj = re.match(self._VALID_URL, url)
26 video_id = mobj.group('id')
28 webpage = self._download_webpage(url, video_id)
30 video_url = self._html_search_regex(
31 r"'480p'\s*:\s*'([^']+)'", webpage, 'video URL')
33 title = self._html_search_regex(
34 r'<title>([^<]+)\s*-\s*beeg\.?</title>', webpage, 'title')
36 description = self._html_search_regex(
37 r'<meta name="description" content="([^"]*)"',
38 webpage, 'description', fatal=False)
39 thumbnail = self._html_search_regex(
40 r'\'previewer.url\'\s*:\s*"([^"]*)"',
41 webpage, 'thumbnail', fatal=False)
43 categories_str = self._html_search_regex(
44 r'<meta name="keywords" content="([^"]+)"', webpage, 'categories', fatal=False)
46 None if categories_str is None
47 else categories_str.split(','))
53 'description': description,
54 'thumbnail': thumbnail,
55 'categories': categories,