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

verification problems??? #10

Closed
wizwardicuz opened this issue Jul 6, 2023 · 4 comments
Closed

verification problems??? #10

wizwardicuz opened this issue Jul 6, 2023 · 4 comments

Comments

@wizwardicuz
Copy link

Fairly new to python and stuff, have used this in the past to download magazines just fine. Bought some new ones and ran into some issues, one of which was already described here due to problems with the "original" quality setting. I downloaded the newest version of the code and tried to get the extrahigh quality to work, but something is still going wrong. I've included the readout below:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/alexis/Downloads/pocketmagstopdf-main/pocketmagstopdf.py", line 757, in
main()
File "/Users/alexis/Downloads/pocketmagstopdf-main/pocketmagstopdf.py", line 361, in main
with urlopen(page_url) as f:
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

I do not have enough experience with coding to even begin to understand what this means. Thanks in advance for your help :)

@lkowolowski
Copy link

Looks like verification of the certificate failed. If there is an option to not verify, that would probably fix it. If not, sounds like a feature request 🙂

@RichardJRL
Copy link
Owner

RichardJRL commented Jul 6, 2023

I'm afraid I cannot replicate this with the information provided. Still stuck with the original quality problem as I haven't had the time to devote to researching it, but just testing again now with high and extrahigh quality I'm having no issues with my limited number of previously purchased magazines.

To further investigate your problem, can you try passing a plain http URL to the script instead of https? I've just checked and the pocketmags data sources don't redirect to https if you only use http for the initial query.

Looking at the traceback it looks like Python can't find an up-to-date set of SSL certs on your computer given that it says unable to get local issuer certificate. Try running pip install --upgrade certifi from the terminal...

What operating system are you using?

Edit: Also dropping this in here for reference, and in case you are using MacOS: Rapptz/discord.py#423 (comment)

@wizwardicuz
Copy link
Author

Using http did make it work. I'm using MacOS and have upgraded certificates, tested it again and the issue appears to be resolved! Thank you! :D

@RichardJRL
Copy link
Owner

Glad it's resolved for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants