Yen Chi Hsuan
8 years ago
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30
1 changed files with
7 additions and
2 deletions
-
youtube_dl/utils.py
|
@ -883,12 +883,17 @@ def make_socks_conn_class(base_class, socks_proxy): |
|
|
elif url_components.scheme.lower() == 'socks4a': |
|
|
elif url_components.scheme.lower() == 'socks4a': |
|
|
socks_type = ProxyType.SOCKS4A |
|
|
socks_type = ProxyType.SOCKS4A |
|
|
|
|
|
|
|
|
|
|
|
def unquote_if_non_empty(s): |
|
|
|
|
|
if not s: |
|
|
|
|
|
return s |
|
|
|
|
|
return compat_urllib_parse_unquote_plus(s) |
|
|
|
|
|
|
|
|
proxy_args = ( |
|
|
proxy_args = ( |
|
|
socks_type, |
|
|
socks_type, |
|
|
url_components.hostname, url_components.port or 1080, |
|
|
url_components.hostname, url_components.port or 1080, |
|
|
True, # Remote DNS |
|
|
True, # Remote DNS |
|
|
compat_urllib_parse_unquote_plus(url_components.username), |
|
|
|
|
|
compat_urllib_parse_unquote_plus(url_components.password), |
|
|
|
|
|
|
|
|
unquote_if_non_empty(url_components.username), |
|
|
|
|
|
unquote_if_non_empty(url_components.password), |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
class SocksConnection(base_class): |
|
|
class SocksConnection(base_class): |
|
|