]>
Commit | Line | Data |
---|---|---|
1986025d | 1 | from .common import InfoExtractor |
736f003f | 2 | from ..compat import compat_urllib_parse_unquote |
1986025d PH |
3 | |
4 | ||
5 | class XBefIE(InfoExtractor): | |
5886b38d | 6 | _VALID_URL = r'https?://(?:www\.)?xbef\.com/video/(?P<id>[0-9]+)' |
1986025d PH |
7 | _TEST = { |
8 | 'url': 'http://xbef.com/video/5119-glamourous-lesbians-smoking-drinking-and-fucking', | |
9 | 'md5': 'a478b565baff61634a98f5e5338be995', | |
10 | 'info_dict': { | |
11 | 'id': '5119', | |
12 | 'ext': 'mp4', | |
13 | 'title': 'md5:7358a9faef8b7b57acda7c04816f170e', | |
14 | 'age_limit': 18, | |
ec85ded8 | 15 | 'thumbnail': r're:^http://.*\.jpg', |
1986025d PH |
16 | } |
17 | } | |
18 | ||
19 | def _real_extract(self, url): | |
1cc79574 | 20 | video_id = self._match_id(url) |
1986025d | 21 | webpage = self._download_webpage(url, video_id) |
1cc79574 | 22 | |
1986025d PH |
23 | title = self._html_search_regex( |
24 | r'<h1[^>]*>(.*?)</h1>', webpage, 'title') | |
25 | ||
26 | config_url_enc = self._download_webpage( | |
27 | 'http://xbef.com/Main/GetVideoURLEncoded/%s' % video_id, video_id, | |
28 | note='Retrieving config URL') | |
736f003f | 29 | config_url = compat_urllib_parse_unquote(config_url_enc) |
1986025d PH |
30 | config = self._download_xml( |
31 | config_url, video_id, note='Retrieving config') | |
32 | ||
33 | video_url = config.find('./file').text | |
34 | thumbnail = config.find('./image').text | |
35 | ||
36 | return { | |
37 | 'id': video_id, | |
38 | 'url': video_url, | |
39 | 'title': title, | |
40 | 'thumbnail': thumbnail, | |
41 | 'age_limit': 18, | |
42 | } |