]> Raphaƫl G. Git Repositories - youtubedl/blobdiff - youtube_dl/extractor/shared.py
Initiate new release.
[youtubedl] / youtube_dl / extractor / shared.py
index c5636e8e92fdf772bb102675294c2e100315b5ca..e7e5f653eb2117936f568195e508f9e7778b1085 100644 (file)
@@ -3,19 +3,17 @@ from __future__ import unicode_literals
 import base64
 
 from .common import InfoExtractor
 import base64
 
 from .common import InfoExtractor
-from ..compat import (
-    compat_urllib_parse,
-    compat_urllib_request,
-)
 from ..utils import (
     ExtractorError,
     int_or_none,
 from ..utils import (
     ExtractorError,
     int_or_none,
+    sanitized_Request,
+    urlencode_postdata,
 )
 
 
 class SharedIE(InfoExtractor):
     IE_DESC = 'shared.sx and vivo.sx'
 )
 
 
 class SharedIE(InfoExtractor):
     IE_DESC = 'shared.sx and vivo.sx'
-    _VALID_URL = r'http://(?:shared|vivo)\.sx/(?P<id>[\da-z]{10})'
+    _VALID_URL = r'https?://(?:shared|vivo)\.sx/(?P<id>[\da-z]{10})'
 
     _TESTS = [{
         'url': 'http://shared.sx/0060718775',
 
     _TESTS = [{
         'url': 'http://shared.sx/0060718775',
@@ -46,8 +44,8 @@ class SharedIE(InfoExtractor):
                 'Video %s does not exist' % video_id, expected=True)
 
         download_form = self._hidden_inputs(webpage)
                 'Video %s does not exist' % video_id, expected=True)
 
         download_form = self._hidden_inputs(webpage)
-        request = compat_urllib_request.Request(
-            url, compat_urllib_parse.urlencode(download_form))
+        request = sanitized_Request(
+            url, urlencode_postdata(download_form))
         request.add_header('Content-Type', 'application/x-www-form-urlencoded')
 
         video_page = self._download_webpage(
         request.add_header('Content-Type', 'application/x-www-form-urlencoded')
 
         video_page = self._download_webpage(