[YoutubeDL] Rename alternative proxy to China verification proxy
Documentations are updated as well to make the purpose of the new option more clear
This commit is contained in:
parent
63367c442b
commit
3981ef4c2a
@ -1721,7 +1721,7 @@ class YoutubeDL(object):
|
||||
self._write_string('[debug] exe versions: %s\n' % exe_str)
|
||||
|
||||
self.dump_proxy_map('default', 'Proxy map')
|
||||
self.dump_proxy_map('alternative', 'Alternative proxy map')
|
||||
self.dump_proxy_map('cn_verification', 'China IP verification proxy map')
|
||||
|
||||
if self.params.get('call_home', False):
|
||||
ipaddr = self.urlopen('https://yt-dl.org/ip').read().decode('utf-8')
|
||||
@ -1761,12 +1761,13 @@ class YoutubeDL(object):
|
||||
ydlh = YoutubeDLHandler(self.params, debuglevel=debuglevel)
|
||||
|
||||
default_proxy = self.params.get('proxy')
|
||||
alternative_proxy = self.params.get('alternative_proxy')
|
||||
if not alternative_proxy:
|
||||
alternative_proxy = default_proxy
|
||||
cn_verification_proxy = self.params.get('cn_verification_proxy')
|
||||
|
||||
if not cn_verification_proxy:
|
||||
cn_verification_proxy = default_proxy
|
||||
|
||||
self._setup_single_opener('default', default_proxy, https_handler, ydlh)
|
||||
self._setup_single_opener('alternative', alternative_proxy, https_handler, ydlh)
|
||||
self._setup_single_opener('cn_verification', cn_verification_proxy, https_handler, ydlh)
|
||||
|
||||
def _setup_single_opener(self, opener_name, opts_proxy, https_handler, ydlh):
|
||||
cookie_processor = compat_urllib_request.HTTPCookieProcessor(
|
||||
|
@ -57,7 +57,7 @@ class LetvIE(InfoExtractor):
|
||||
'publish time'
|
||||
],
|
||||
'params': {
|
||||
'alternative_proxy': 'proxy.uku.im:8888'
|
||||
'cn_verification_proxy': 'proxy.uku.im:8888'
|
||||
}
|
||||
}]
|
||||
|
||||
@ -94,7 +94,7 @@ class LetvIE(InfoExtractor):
|
||||
|
||||
play_json = self._download_json(
|
||||
'http://api.letv.com/mms/out/video/playJson?' + compat_urllib_parse.urlencode(params),
|
||||
media_id, 'playJson data', opener_name='alternative')
|
||||
media_id, 'playJson data', opener_name='cn_verification')
|
||||
|
||||
# Check for errors
|
||||
playstatus = play_json['playstatus']
|
||||
|
@ -177,9 +177,9 @@ def parseOpts(overrideArguments=None):
|
||||
default=None, metavar='URL',
|
||||
help='Use the specified HTTP/HTTPS proxy. Pass in an empty string (--proxy "") for direct connection')
|
||||
network.add_option(
|
||||
'--alternative-proxy', dest='alternative_proxy',
|
||||
'--cn-verification-proxy', dest='cn_verification_proxy',
|
||||
default=None, metavar='URL',
|
||||
help='Use the specified HTTP/HTTPS address as the alternative proxy. Pass in an empty string (--alternative-proxy "") for direct connection'
|
||||
help='The proxy used in the China IP verification step. The default proxy specified by --proxy is used if this option is not given'
|
||||
)
|
||||
network.add_option(
|
||||
'--socket-timeout',
|
||||
|
Loading…
x
Reference in New Issue
Block a user