2 from __future__ import unicode_literals
6 from .common import InfoExtractor
12 from ..compat import compat_urllib_request
15 class VidtoIE(InfoExtractor):
18 _VALID_URL = r'https?://(?:www\.)?vidto\.me/(?P<id>[0-9a-zA-Z]+)\.html'
20 'url': 'http://vidto.me/ku5glz52nqe1.html',
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
31 page = self._download_webpage(
32 'http://vidto.me/%s.html' % video_id, video_id, 'Downloading video page')
34 title = remove_end(self._html_search_regex(
35 r'<Title>\s*([^<]+)\s*</Title>', page, 'title'), ' - Vidto')
37 hidden_fields = self._hidden_inputs(page)
39 self.to_screen('Waiting for countdown...')
42 req = compat_urllib_request.Request(
43 url, urlencode_postdata(encode_dict(hidden_fields)))
44 req.add_header('Content-type', 'application/x-www-form-urlencoded')
46 post_result = self._download_webpage(
48 note='Proceed to video...', errnote='unable to proceed')
50 file_link = self._search_regex(
51 r'file_link\s*=\s*\'(https?:\/\/[0-9a-zA-z.\/\-_]+)', post_result, 'file_link')