diff options
| author | Jaime Marquínez Ferrándiz <jaimemf93@gmail.com> | 2013-03-05 22:33:32 +0100 | 
|---|---|---|
| committer | Jaime Marquínez Ferrándiz <jaimemf93@gmail.com> | 2013-03-05 22:33:32 +0100 | 
| commit | a0d6fe7b924697c089ed7ae37df0ca590ac38a96 (patch) | |
| tree | e180467a5393d541fc764a9717a6768c89bcd97b /youtube_dl/InfoExtractors.py | |
| parent | 8a38a194fb08a253986cdbafa02cf699ef76c9a5 (diff) | |
When a redirect is found return the new url using the new style
Diffstat (limited to 'youtube_dl/InfoExtractors.py')
| -rwxr-xr-x | youtube_dl/InfoExtractors.py | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 895658f49..e714fa6b0 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -1311,7 +1311,7 @@ class GenericIE(InfoExtractor):          self._downloader.to_screen(u'[redirect] Following redirect to %s' % new_url)      def _test_redirect(self, url): -        """Check if it is a redirect, like url shorteners, in case restart chain.""" +        """Check if it is a redirect, like url shorteners, in case return the new url."""          class HeadRequest(compat_urllib_request.Request):              def get_method(self):                  return "HEAD" @@ -1362,11 +1362,11 @@ class GenericIE(InfoExtractor):              return False          self.report_following_redirect(new_url) -        self._downloader.download([new_url]) -        return True +        return new_url      def _real_extract(self, url): -        if self._test_redirect(url): return +        new_url = self._test_redirect(url) +        if new_url: return [self.url_result(new_url)]          video_id = url.split('/')[-1]          request = compat_urllib_request.Request(url)  | 
