1 from __future__ import unicode_literals
5 from .common import InfoExtractor
6 from ..utils import fix_xml_ampersands
9 class EmpflixIE(InfoExtractor):
10 _VALID_URL = r'^https?://www\.empflix\.com/videos/.*?-(?P<id>[0-9]+)\.html'
12 'url': 'http://www.empflix.com/videos/Amateur-Finger-Fuck-33051.html',
13 'md5': 'b1bc15b6412d33902d6e5952035fcabc',
17 'title': 'Amateur Finger Fuck',
18 'description': 'Amateur solo finger fucking.',
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)
28 age_limit = self._rta_search(webpage)
30 video_title = self._html_search_regex(
31 r'name="title" value="(?P<title>[^"]*)"', webpage, 'title')
32 video_description = self._html_search_regex(
33 r'name="description" value="([^"]*)"', webpage, 'description', fatal=False)
35 cfg_url = self._html_search_regex(
36 r'flashvars\.config = escape\("([^"]+)"',
37 webpage, 'flashvars.config')
39 cfg_xml = self._download_xml(
40 cfg_url, video_id, note='Downloading metadata',
41 transform_source=fix_xml_ampersands)
45 'url': item.find('videoLink').text,
46 'format_id': item.find('res').text,
47 } for item in cfg_xml.findall('./quality/item')
49 thumbnail = cfg_xml.find('./startThumb').text
54 'description': video_description,
55 'thumbnail': thumbnail,
57 'age_limit': age_limit,