]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[shared] Respect redirect URL (Closes #10170)
authorSergey M․ <dstftw@gmail.com>
Wed, 27 Jul 2016 16:28:01 +0000 (23:28 +0700)
committerSergey M․ <dstftw@gmail.com>
Wed, 27 Jul 2016 16:28:01 +0000 (23:28 +0700)
youtube_dl/extractor/shared.py

index e7e5f653eb2117936f568195e508f9e7778b1085..6757e6ccfe9e7d5b2ceafd4e7ff0ba3556797c8e 100644 (file)
@@ -37,15 +37,17 @@ class SharedIE(InfoExtractor):
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
-        webpage = self._download_webpage(url, video_id)
+
+        webpage, urlh = self._download_webpage_handle(url, video_id)
 
         if '>File does not exist<' in webpage:
             raise ExtractorError(
                 'Video %s does not exist' % video_id, expected=True)
 
         download_form = self._hidden_inputs(webpage)
+
         request = sanitized_Request(
-            url, urlencode_postdata(download_form))
+            urlh.geturl(), urlencode_postdata(download_form))
         request.add_header('Content-Type', 'application/x-www-form-urlencoded')
 
         video_page = self._download_webpage(