Open tlelson opened 5 years ago
can you try run?
>>> from urllib.request import Request, urlopen
... import certifi
... from we_get.core.utils import random_user_agent
... USER_AGENT = random_user_agent()
... url = 'https://thepiratebay.org/search/ubuntu/0/99/0'
... resp = urlopen(
... Request(url, headers={'User-Agent': USER_AGENT}),
... cafile=certifi.where())
>>> resp.read()
...
Describe the bug README.md behaviour not replicable.
To Reproduce
Install
Try download as per README.md
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/minmac/miniconda3/envs/general/bin/we-get", line 11, in
load_entry_point('we-get', 'console_scripts', 'we-get')()
File "/Users/minmac/Downloads/we-get/we_get/init.py", line 14, in main
we_get.start()
File "/Users/minmac/Downloads/we-get/we_get/core/we_get.py", line 246, in start
sel.run()
File "/Users/minmac/Downloads/we-get/we_get/core/we_get.py", line 162, in run
items = run.main(self.pargs)
File "/Users/minmac/Downloads/we-get/we_get/modules/the_pirate_bay.py", line 78, in main
return run.search()
File "/Users/minmac/Downloads/we-get/we_get/modules/the_pirate_bay.py", line 62, in search
data = self.module.http_get_request(url)
File "/Users/minmac/Downloads/we-get/we_get/core/module.py", line 24, in http_get_request
return opener.open(url).read().decode()
File "/Users/minmac/miniconda3/envs/general/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Users/minmac/miniconda3/envs/general/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/Users/minmac/miniconda3/envs/general/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/Users/minmac/miniconda3/envs/general/lib/python3.7/urllib/request.py", line 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Users/minmac/miniconda3/envs/general/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'thepiratebay.org'. (_ssl.c:1056)>
(general) minmac@minmacMBP:~ ❯