X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fmoniker.py;h=b208820fe64970b3f7b362dba13c534a6955686d;hb=54fc90aabfb71968f28af68dfe3f7a3544cc2f0b;hp=7c0c4e50e7c00d5bf66b30ee77deabc562fe2f07;hpb=30eecc6a044d4070d0e8ea4a6e0637867f0d3a28;p=youtube-dl diff --git a/youtube_dl/extractor/moniker.py b/youtube_dl/extractor/moniker.py index 7c0c4e50e..b208820fe 100644 --- a/youtube_dl/extractor/moniker.py +++ b/youtube_dl/extractor/moniker.py @@ -5,13 +5,11 @@ import os.path import re from .common import InfoExtractor -from ..compat import ( - compat_urllib_parse, - compat_urllib_request, -) from ..utils import ( ExtractorError, remove_start, + sanitized_Request, + urlencode_postdata, ) @@ -81,7 +79,7 @@ class MonikerIE(InfoExtractor): orig_webpage, 'builtin URL', default=None, group='url') if builtin_url: - req = compat_urllib_request.Request(builtin_url) + req = sanitized_Request(builtin_url) req.add_header('Referer', url) webpage = self._download_webpage(req, video_id, 'Downloading builtin page') title = self._og_search_title(orig_webpage).strip() @@ -90,11 +88,11 @@ class MonikerIE(InfoExtractor): fields = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', orig_webpage) data = dict(fields) - post = compat_urllib_parse.urlencode(data) + post = urlencode_postdata(data) headers = { b'Content-Type': b'application/x-www-form-urlencoded', } - req = compat_urllib_request.Request(url, post, headers) + req = sanitized_Request(url, post, headers) webpage = self._download_webpage( req, video_id, note='Downloading video page ...')