X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fsocks.py;h=5d4adbe72de5d273a11f0fc2d66b7829c4bbfb37;hb=54f54fcca7af7e5bbc779cfc73d58d1ed2b4b6ae;hp=0f5d7bdb2128b17c2e1dba3144ff01d9b3d2f06a;hpb=facfd79f9ad574db7bfcc90cbef01b3a7e7b1262;p=youtube-dl 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')