0
votes
import pafy
url="https://www.youtube.com/watch?v=EFzOA0-jfOo"
v= pafy.new(url)
print(v.title)

ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1317, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/utils.py", line 2726, in https_open return self.do_open(functools.partial( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 797, in extract_info ie_result = ie.extract(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 530, in extract ie_result = self._real_extract(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py", line 1681, in _real_extract video_webpage = self._download_webpage(url, video_id) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 791, in _download_webpage res = self._download_webpage_handle( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py", line 271, in _download_webpage_handle return super(YoutubeBaseInfoExtractor, self)._download_webpage_handle( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 660, in _download_webpage_handle urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 645, in _request_webpage raise ExtractorError(errmsg, sys.exc_info()[2], cause=err) youtube_dl.utils.ExtractorError: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 40, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 820, in extract_info self.report_error(compat_str(e), e.format_traceback()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 625, in report_error self.trouble(error_message, tb) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 595, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "YtDow.py", line 3, in v= pafy.new(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 31, in init super(YtdlPafy, self).init(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_shared.py", line 97, in init self._fetch_basic() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 43, in _fetch_basic raise IOError(str(e).replace('YouTube said', 'Youtube says')) OSError: ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) venkatrimmalapudi@Venkats-MacBook-Air python % vi YtDow.py
venkatrimmalapudi@Venkats-MacBook-Air python % python3 YtDow.py ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1317, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/utils.py", line 2726, in https_open return self.do_open(functools.partial( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 797, in extract_info ie_result = ie.extract(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 530, in extract ie_result = self._real_extract(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py", line 1681, in _real_extract video_webpage = self._download_webpage(url, video_id) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 791, in _download_webpage res = self._download_webpage_handle( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py", line 271, in _download_webpage_handle return super(YoutubeBaseInfoExtractor, self)._download_webpage_handle( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 660, in _download_webpage_handle urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 645, in _request_webpage raise ExtractorError(errmsg, sys.exc_info()[2], cause=err) youtube_dl.utils.ExtractorError: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 40, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 820, in extract_info self.report_error(compat_str(e), e.format_traceback()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 625, in report_error self.trouble(error_message, tb) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 595, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "YtDow.py", line 3, in v= pafy.new(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 31, in init super(YtdlPafy, self).init(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_shared.py", line 97, in init self._fetch_basic() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 43, in _fetch_basic raise IOError(str(e).replace('YouTube said', 'Youtube says')) OSError: ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) venkatrimmalapudi@Venkats-MacBook-Air python % vi YtDow.py
venkatrimmalapudi@Venkats-MacBook-Air python % python3 YtDow.py ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1317, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 627, in _request_webpage return self._downloader.urlopen(url_or_request) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/utils.py", line 2726, in https_open return self.do_open(functools.partial( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1320, in do_open raise URLError(err) urllib.error.URLError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 797, in extract_info ie_result = ie.extract(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 530, in extract ie_result = self._real_extract(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py", line 1681, in _real_extract video_webpage = self._download_webpage(url, video_id) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 791, in _download_webpage res = self._download_webpage_handle( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/youtube.py", line 271, in _download_webpage_handle return super(YoutubeBaseInfoExtractor, self)._download_webpage_handle( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 660, in _download_webpage_handle urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 645, in _request_webpage raise ExtractorError(errmsg, sys.exc_info()[2], cause=err) youtube_dl.utils.ExtractorError: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 40, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 820, in extract_info self.report_error(compat_str(e), e.format_traceback()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 625, in report_error self.trouble(error_message, tb) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 595, in trouble raise DownloadError(message, exc_info) youtube_dl.utils.DownloadError: ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "YtDow.py", line 3, in v= pafy.new(url) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 31, in init super(YtdlPafy, self).init(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_shared.py", line 97, in init self._fetch_basic() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pafy/backend_youtube_dl.py", line 43, in _fetch_basic raise IOError(str(e).replace('YouTube said', 'Youtube says')) OSError: ERROR: Unable to download webpage: (caused by URLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

1

1 Answers

1
votes

do a global search for a file named Install Certificates.command. It is located inside python folder. Double click on it and the error should disappear