Youku: fix a regression bug which caused '-y' not work

* d6ec844 is not implemented correctly (unfortunately)
This commit is contained in:
Mort Yao 2014-09-20 22:23:59 +02:00
parent 655e26acd1
commit c63155a334

View File

@ -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)