alexmercerind/youtube-search-python

Exception: ERROR: Could not make request. (SSL Issue

Closed this issue · 2 comments

I'm on windows, and I can access to youtube.
Error log:

Traceback (most recent call last): File "C:\Program Files\Python38\lib\urllib\request.py", line 1354, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\Program Files\Python38\lib\http\client.py", line 1252, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\Program Files\Python38\lib\http\client.py", line 1298, in _send_reque st self.endheaders(body, encode_chunked=encode_chunked) File "C:\Program Files\Python38\lib\http\client.py", line 1247, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\Program Files\Python38\lib\http\client.py", line 1007, in _send_outpu t self.send(msg) File "C:\Program Files\Python38\lib\http\client.py", line 947, in send self.connect() File "C:\Program Files\Python38\lib\http\client.py", line 1421, in connect self.sock = self._context.wrap_socket(self.sock, File "C:\Program Files\Python38\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\Program Files\Python38\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\Program Files\Python38\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif y failed: unable to get local issuer certificate (_ssl.c:1131)

The temporal solution for my code:

Add at the begining
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

mytja commented

Interesting... I personally don't get this error, but many others have occoured on this error.
In any case, you can create a PR, and add this, otherwise I will take care of it...

mytja commented

The solution you provided is depricated. You can use it in your code, but I won't implement it.
Sorry it has been taking so long & hope you understand