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)