Wolf_Yout
@Wolf_Yout

Yandex-music-api Выдаёт ошибку макс.кол-ва запросов при попытке подколючиться через Proxy, как исправить?

Я хочу подключить яндекс музыку через прокси, чтобы она работала на хостинге(Который находится вне СНГ) и в файле README нашёл образец:
from yandex_music.utils.request import Request
from yandex_music import Client
request = Request(proxy_url='https://193.138.178.6:8282')
client = Client("Token", request=request).init()

Прокси взят с бесплатного сайта
При запуске сначала очень долгое ожидание, потом возвращает ошибку:
Traceback (most recent call last):
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 700, in urlopen
    self._prepare_proxy(conn)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 996, in _prepare_proxy
    conn.connect()
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 364, in connect
    self.sock = conn = self._connect_tls_proxy(hostname, conn)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 499, in _connect_tls_proxy
    socket = ssl_wrap_socket(
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1122)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 489, in send
    resp = conn.urlopen(
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\utils\request.py", line 196, in _request_wrapper
    resp = requests.request(*args, **kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 563, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Вульф\OneDrive\Документы\Python Projects\0XB1\main.py", line 29, in <module>
    client = Client("y0_AgAAAABCYqrDAAG8XgAAAADWMujSSbuFlQssRKSr1s1FW9hf-KoRuaE", request=request).init()
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\client.py", line 66, in wrapper
    result = method(*args, **kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\client.py", line 152, in init
    self.me = self.account_status()
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\client.py", line 66, in wrapper
    result = method(*args, **kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\client.py", line 173, in account_status
    result = self._request.get(url, timeout=timeout, *args, **kwargs)
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\utils\request.py", line 242, in get
    result = self._request_wrapper(
  File "C:\Users\Вульф\AppData\Local\Programs\Python\Python39\lib\site-packages\yandex_music\utils\request.py", line 200, in _request_wrapper
    raise NetworkError(e)
yandex_music.exceptions.NetworkError: HTTPSConnectionPool(host='api.music.yandex.net', port=443): Max retries exceeded with url: /account/status (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)')))
  • Вопрос задан
  • 141 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы