1 from __future__ import unicode_literals
3 from .common import InfoExtractor
10 class BeegIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?beeg\.com/(?P<id>\d+)'
13 'url': 'http://beeg.com/5416503',
14 'md5': '46c384def73b33dbc581262e5ee67cef',
18 'title': 'Sultry Striptease',
19 'description': 'md5:d22219c09da287c14bed3d6c37ce4bc2',
20 'timestamp': 1391813355,
21 'upload_date': '20140207',
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
31 video = self._download_json(
32 'http://beeg.com/api/v1/video/%s' % video_id, video_id)
35 for format_id, video_url in video.items():
36 height = self._search_regex(
37 r'^(\d+)[pP]$', format_id, 'height', default=None)
41 'url': self._proto_relative_url(video_url.replace('{DATA_MARKERS}', ''), 'http:'),
42 'format_id': format_id,
43 'height': int(height),
45 self._sort_formats(formats)
47 title = video['title']
48 video_id = video.get('id') or video_id
49 display_id = video.get('code')
50 description = video.get('desc')
52 timestamp = parse_iso8601(video.get('date'), ' ')
53 duration = int_or_none(video.get('duration'))
55 tags = [tag.strip() for tag in video['tags'].split(',')] if video.get('tags') else None
59 'display_id': display_id,
61 'description': description,
62 'timestamp': timestamp,