From c63155a33456acb7e34c1f498bcd21d3e99590ea Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 20 Sep 2014 22:23:59 +0200 Subject: [PATCH] Youku: fix a regression bug which caused '-y' not work * d6ec844 is not implemented correctly (unfortunately) --- src/you_get/extractor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/you_get/extractor.py b/src/you_get/extractor.py index f8ed9530..14fc5b7b 100644 --- a/src/you_get/extractor.py +++ b/src/you_get/extractor.py @@ -33,6 +33,8 @@ class VideoExtractor(): if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']: set_proxy(parse_host(kwargs['extractor_proxy'])) self.prepare(**kwargs) + if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']: + unset_proxy() try: self.streams_sorted = [dict([('id', stream_type['id'])] + list(self.streams[stream_type['id']].items())) for stream_type in self.__class__.stream_types if stream_type['id'] in self.streams] @@ -41,9 +43,6 @@ class VideoExtractor(): self.extract(**kwargs) - if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']: - unset_proxy() - self.download(**kwargs) def download_by_vid(self, vid, **kwargs): @@ -52,6 +51,8 @@ class VideoExtractor(): if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']: set_proxy(parse_host(kwargs['extractor_proxy'])) self.prepare(**kwargs) + if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']: + unset_proxy() try: self.streams_sorted = [dict([('id', stream_type['id'])] + list(self.streams[stream_type['id']].items())) for stream_type in self.__class__.stream_types if stream_type['id'] in self.streams] @@ -59,8 +60,6 @@ class VideoExtractor(): self.streams_sorted = [dict([('itag', stream_type['itag'])] + list(self.streams[stream_type['itag']].items())) for stream_type in self.__class__.stream_types if stream_type['itag'] in self.streams] self.extract(**kwargs) - if 'extractor_proxy' in kwargs and kwargs['extractor_proxy']: - unset_proxy() self.download(**kwargs)