2 from __future__ import unicode_literals
6 from .common import InfoExtractor
13 class MegaVideozIE(InfoExtractor):
14 _VALID_URL = r'https?://(?:www\.)?megavideoz\.eu/video/(?P<id>[^/]+)(?:/(?P<display_id>[^/]+))?'
16 'url': 'http://megavideoz.eu/video/WM6UB919XMXH/SMPTE-Universal-Film-Leader',
19 'display_id': 'SMPTE-Universal-Film-Leader',
21 'title': 'SMPTE Universal Film Leader',
22 'thumbnail': 're:https?://.*?\.jpg',
27 def _real_extract(self, url):
28 mobj = re.match(self._VALID_URL, url)
29 video_id = mobj.group('id')
30 display_id = mobj.group('display_id') or video_id
32 webpage = self._download_webpage(url, display_id)
34 config = self._download_xml(
36 r"var\s+cnf\s*=\s*'([^']+)'", webpage, 'cnf url'),
39 video_url = xpath_text(config, './file', 'video url', fatal=True)
40 title = xpath_text(config, './title', 'title', fatal=True)
41 thumbnail = xpath_text(config, './image', 'thumbnail')
42 duration = float_or_none(xpath_text(config, './duration', 'duration'))
43 video_id = xpath_text(config, './mediaid', 'video id') or video_id
47 'display_id': display_id,
50 'thumbnail': thumbnail,