1 from __future__ import unicode_literals
3 from .common import InfoExtractor
4 from ..compat import compat_urllib_parse_unquote
7 class XBefIE(InfoExtractor):
8 _VALID_URL = r'http://(?:www\.)?xbef\.com/video/(?P<id>[0-9]+)'
10 'url': 'http://xbef.com/video/5119-glamourous-lesbians-smoking-drinking-and-fucking',
11 'md5': 'a478b565baff61634a98f5e5338be995',
15 'title': 'md5:7358a9faef8b7b57acda7c04816f170e',
17 'thumbnail': 're:^http://.*\.jpg',
21 def _real_extract(self, url):
22 video_id = self._match_id(url)
23 webpage = self._download_webpage(url, video_id)
25 title = self._html_search_regex(
26 r'<h1[^>]*>(.*?)</h1>', webpage, 'title')
28 config_url_enc = self._download_webpage(
29 'http://xbef.com/Main/GetVideoURLEncoded/%s' % video_id, video_id,
30 note='Retrieving config URL')
31 config_url = compat_urllib_parse_unquote(config_url_enc)
32 config = self._download_xml(
33 config_url, video_id, note='Retrieving config')
35 video_url = config.find('./file').text
36 thumbnail = config.find('./image').text
42 'thumbnail': thumbnail,