aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/socks.py
diff options
context:
space:
mode:
authorTithen-Firion <Tithen-Firion@users.noreply.github.com>2017-05-04 11:00:06 +0200
committerGitHub <noreply@github.com>2017-05-04 11:00:06 +0200
commitc89267d31ad99eb5b1a87cd354de5280a2a087b1 (patch)
tree8bb3b01cd088d0646089344bddd3d4ff272c0065 /youtube_dl/socks.py
parent7552f96352f35cd877e52fd0770b77ba1856fc62 (diff)
parent0c265486016b06342fb257966474ce591667aaff (diff)
downloadyoutube-dl-c89267d31ad99eb5b1a87cd354de5280a2a087b1.tar.xz
Merge branch 'master' into openload-phantomjs-method
Diffstat (limited to 'youtube_dl/socks.py')
-rw-r--r--youtube_dl/socks.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/socks.py b/youtube_dl/socks.py
index 0f5d7bdb2..5d4adbe72 100644
--- a/youtube_dl/socks.py
+++ b/youtube_dl/socks.py
@@ -193,9 +193,10 @@ class sockssocket(socket.socket):
self._check_response_version(SOCKS5_VERSION, version)
- if method == Socks5Auth.AUTH_NO_ACCEPTABLE:
+ if method == Socks5Auth.AUTH_NO_ACCEPTABLE or (
+ method == Socks5Auth.AUTH_USER_PASS and (not self._proxy.username or not self._proxy.password)):
self.close()
- raise Socks5Error(method)
+ raise Socks5Error(Socks5Auth.AUTH_NO_ACCEPTABLE)
if method == Socks5Auth.AUTH_USER_PASS:
username = self._proxy.username.encode('utf-8')