]> Raphaƫl G. Git Repositories - youtubedl/blobdiff - youtube_dl/extractor/moniker.py
Imported Upstream version 2016.02.22
[youtubedl] / youtube_dl / extractor / moniker.py
index 7c0c4e50e7c00d5bf66b30ee77deabc562fe2f07..f6bf94f2f6b3d6868fa098994a2d275f8bb59a99 100644 (file)
@@ -5,13 +5,11 @@ import os.path
 import re
 
 from .common import InfoExtractor
 import re
 
 from .common import InfoExtractor
-from ..compat import (
-    compat_urllib_parse,
-    compat_urllib_request,
-)
+from ..compat import compat_urllib_parse
 from ..utils import (
     ExtractorError,
     remove_start,
 from ..utils import (
     ExtractorError,
     remove_start,
+    sanitized_Request,
 )
 
 
 )
 
 
@@ -81,7 +79,7 @@ class MonikerIE(InfoExtractor):
             orig_webpage, 'builtin URL', default=None, group='url')
 
         if builtin_url:
             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()
             req.add_header('Referer', url)
             webpage = self._download_webpage(req, video_id, 'Downloading builtin page')
             title = self._og_search_title(orig_webpage).strip()
@@ -94,7 +92,7 @@ class MonikerIE(InfoExtractor):
             headers = {
                 b'Content-Type': b'application/x-www-form-urlencoded',
             }
             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 ...')
 
             webpage = self._download_webpage(
                 req, video_id, note='Downloading video page ...')