2 from __future__ import unicode_literals
6 from .common import InfoExtractor
15 class PromptFileIE(InfoExtractor):
16 _VALID_URL = r'https?://(?:www\.)?promptfile\.com/l/(?P<id>[0-9A-Z\-]+)'
18 'url': 'http://www.promptfile.com/l/D21B4746E9-F01462F0FF',
19 'md5': 'd1451b6302da7215485837aaea882c4c',
21 'id': 'D21B4746E9-F01462F0FF',
24 'thumbnail': 're:^https?://.*\.jpg$',
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
30 webpage = self._download_webpage(url, video_id)
32 if re.search(r'<div.+id="not_found_msg".+>(?!We are).+</div>[^-]', webpage) is not None:
33 raise ExtractorError('Video %s does not exist' % video_id,
36 fields = self._hidden_inputs(webpage)
37 post = urlencode_postdata(fields)
38 req = sanitized_Request(url, post)
39 req.add_header('Content-type', 'application/x-www-form-urlencoded')
40 webpage = self._download_webpage(
41 req, video_id, 'Downloading video page')
43 url = self._html_search_regex(r'url:\s*\'([^\']+)\'', webpage, 'URL')
44 title = self._html_search_regex(
45 r'<span.+title="([^"]+)">', webpage, 'title')
46 thumbnail = self._html_search_regex(
47 r'<div id="player_overlay">.*button>.*?<img src="([^"]+)"',
48 webpage, 'thumbnail', fatal=False, flags=re.DOTALL)
53 'ext': determine_ext(title),
55 self._sort_formats(formats)
60 'thumbnail': thumbnail,