1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
6 from .common import InfoExtractor
10 compat_urllib_request,
14 class VodlockerIE(InfoExtractor):
15 _VALID_URL = r'https?://(?:www\.)?vodlocker.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
18 'url': 'http://vodlocker.com/e8wvyzz4sl42',
19 'md5': 'ce0c2d18fa0735f1bd91b69b0e54aacf',
23 'title': 'Germany vs Brazil',
24 'thumbnail': 're:http://.*\.jpg',
28 def _real_extract(self, url):
29 mobj = re.match(self._VALID_URL, url)
30 video_id = mobj.group('id')
31 webpage = self._download_webpage(url, video_id)
33 fields = dict(re.findall(r'''(?x)<input\s+
40 if fields['op'] == 'download1':
41 self._sleep(3, video_id) # they do detect when requests happen too fast!
42 post = compat_urllib_parse.urlencode(fields)
43 req = compat_urllib_request.Request(url, post)
44 req.add_header('Content-type', 'application/x-www-form-urlencoded')
45 webpage = self._download_webpage(
46 req, video_id, 'Downloading video page')
48 title = self._search_regex(
49 r'id="file_title".*?>\s*(.*?)\s*<span', webpage, 'title')
50 thumbnail = self._search_regex(
51 r'image:\s*"(http[^\"]+)",', webpage, 'thumbnail')
52 url = self._search_regex(
53 r'file:\s*"(http[^\"]+)",', webpage, 'file url')
63 'thumbnail': thumbnail,