X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fhostingbulk.py;h=a3154cfdeccf9b4c18cf5a5b01f7944243fb1509;hb=1de5cd3ba51ce67d9a1cd3b40157058e78e46692;hp=a07dd4962553dccf2a05cbf831ed87bd2c0a5bb6;hpb=136c8bd2757709fa18da3670e34435cb177b0905;p=youtube-dl diff --git a/youtube_dl/extractor/hostingbulk.py b/youtube_dl/extractor/hostingbulk.py index a07dd4962..a3154cfde 100644 --- a/youtube_dl/extractor/hostingbulk.py +++ b/youtube_dl/extractor/hostingbulk.py @@ -4,9 +4,11 @@ from __future__ import unicode_literals import re from .common import InfoExtractor +from ..compat import ( + compat_urllib_request, +) from ..utils import ( ExtractorError, - compat_urllib_request, int_or_none, urlencode_postdata, ) @@ -30,9 +32,7 @@ class HostingBulkIE(InfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - + video_id = self._match_id(url) url = 'http://hostingbulk.com/{0:}.html'.format(video_id) # Custom request with cookie to set language to English, so our file @@ -57,17 +57,9 @@ class HostingBulkIE(InfoExtractor): thumbnail = self._search_regex( r'', webpage, 'rand') - fields = { - 'id': video_id, - 'method_free': '', - 'method_premium': '', - 'op': 'download2', - 'rand': rand, - 'referer': '', - } + fields = self._hidden_inputs(webpage) + request = compat_urllib_request.Request(url, urlencode_postdata(fields)) request.add_header('Content-type', 'application/x-www-form-urlencoded') response = self._request_webpage(request, video_id,