[Promtfile] fix

This commit is contained in:
Ondřej Bárta 2016-09-25 18:05:12 +02:00
parent 625ad7dc28
commit e08461c0e8

View File

@ -16,7 +16,7 @@ class PromptFileIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?promptfile\.com/l/(?P<id>[0-9A-Z\-]+)'
_TEST = {
'url': 'http://www.promptfile.com/l/86D1CE8462-576CAAE416',
'md5': '2125298091532905922013119cc3d2e9',
'md5': '5a7e285a26e0d66d9a263fae91bc92ce',
'info_dict': {
'id': '86D1CE8462-576CAAE416',
'ext': 'mp4',
@ -34,9 +34,9 @@ class PromptFileIE(InfoExtractor):
expected=True)
chash_pattern = r'\$\("#chash"\)\.val\("(.+)"\+\$\("#chash"\)'
chash = self._search_regex(chash_pattern, webpage, "chash")
chash = self._html_search_regex(chash_pattern, webpage, "chash")
fields = self._hidden_inputs(webpage)
k = fields.keys()[0]
k = list(fields)[0]
fields[k] = chash + fields[k]
post = urlencode_postdata(fields)
@ -45,7 +45,8 @@ class PromptFileIE(InfoExtractor):
webpage = self._download_webpage(
req, video_id, 'Downloading video page')
url = self._html_search_regex(r'url:\s*\'([^\']+)\'', webpage, 'URL')
url_pattern = r'<a href="(http://www\.promptfile\.com/file/[^"]+)'
url = self._html_search_regex(url_pattern, webpage, 'URL')
title = self._html_search_regex(
r'<span.+title="([^"]+)">', webpage, 'title')
thumbnail = self._html_search_regex(