Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка авторизации с использованием прокси #159

Closed
makar47 opened this issue Dec 15, 2019 · 1 comment
Labels
bug Что-то не работает

Comments

@makar47
Copy link

makar47 commented Dec 15, 2019

Невозможно авторизироваться по логину/паролю с использованием socks5:

request = Request(proxy_url='socks5h://127.0.0.1:9050')
client = Client(request=request).from_credentials('Login', 'Password')

Ошибка:

yandex_music.exceptions.NetworkError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f006249a050>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

Выход из ситуации: получать токен принудительно:

token = Client(request=request).generate_token_by_username_and_password('Login', 'Password')
client = Client(token, request=request)
@MarshalX MarshalX added the bug Что-то не работает label Dec 16, 2019
@MarshalX
Copy link
Owner

Теперь вот так должно работать корректно

request = Request(proxy_url='socks5://user:password@host:port')
client = Client.from_credentials(os.environ.get('LOGIN'), os.environ.get('PASSWORD'), request=request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Что-то не работает
Projects
None yet
Development

No branches or pull requests

2 participants