20
Дек
2017

VK API requests ошибка

Выполняю такой запрос:

requests.get(u'https://api.vk.com/api.php?oauth=1&method=groups.search&q=приколы&sort=0&count=60&access_token=****&fields=is_closed&v=5.53')

Хочу отметить, что в браузере всё выполняется.

В питоне 3.6 как и в 2.7, попробовал в обоих стала вылетать такая ошибка, притом что никогда такого раньше не вылетало, учитывая то, что я этой прогой работаю месяцев 5.

Итак ошибка:

Traceback (most recent call last):
File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 601, in 
urlopen
chunked=chunked)
File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 346, in 
_make_request
self._validate_conn(conn)
File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 850, in 
_validate_conn
conn.connect()
File "C:\Python36\lib\site-packages\urllib3\connection.py", line 326, in 
connect
ssl_context=context)
File "C:\Python36\lib\site-packages\urllib3\util\ssl_.py", line 329, in 
ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Python36\lib\ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "C:\Python36\lib\ssl.py", line 814, in __init__
self.do_handshake()
File "C:\Python36\lib\ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "C:\Python36\lib\ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:777)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Python36\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Python36\lib\site-packages\urllib3\connectionpool.py", line 639, in 
urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Python36\lib\site-packages\urllib3\util\retry.py", line 388, in 
increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.vk.com', port=443): Max retries exceeded with url: /api.php?oauth=1&method=groups.search&q=%D1%82%D1%80%D0%B5%D0%B9%D0%B4%D0%B5%D1%80&sort=0&count=60&access_token=***&fields=is_closed&v=5.53 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
requests.get('https://api.vk.com/api.php?oauth=1&method=groups.search&q=приколы&sort=0&count=60&access_token=***&fields=is_closed&v=5.53')
File "C:\Python36\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Python36\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python36\lib\site-packages\requests\sessions.py", line 508, in 
request
resp = self.send(prep, **send_kwargs)
File "C:\Python36\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python36\lib\site-packages\requests\adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.vk.com', 
port=443): Max retries exceeded with url: /api.php?oauth=1&method=groups.search&q=%D1%82%D1%80%D0%B5%D0%B9%D0%B4%D0%B5%D1%80&sort=0&count=60&access_token=***&fields=is_closed&v=5.53 (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))

В чём может быть проблема?

Источник: https://ru.stackoverflow.com/questions/761115/vk-api-requests-%D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%B0

Тебе может это понравится...

Добавить комментарий