Merge pull request #66 from Olegt0rr/no_proxy_auth

#65 bug fix with no proxy_auth
This commit is contained in:
Alex Root Junior 2018-08-24 20:16:36 +03:00 committed by GitHub
commit 1f4fbaed9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,9 +63,11 @@ class BaseBot:
from aiohttp_socks.helpers import parse_socks_url
socks_ver, host, port, username, password = parse_socks_url(proxy)
if proxy_auth and not username or password:
username = proxy_auth.login
password = proxy_auth.password
if proxy_auth:
if not username:
username = proxy_auth.login
if not password:
password = proxy_auth.password
connector = SocksConnector(socks_ver=socks_ver, host=host, port=port,
username=username, password=password,