quora-plus-bypass icon indicating copy to clipboard operation
quora-plus-bypass copied to clipboard

Url is given but it still throws an error

Open pranshuthegamer opened this issue 3 years ago • 3 comments

pranshuthegamer avatar Jan 17 '22 06:01 pranshuthegamer

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)

pranshuthegamer avatar Jan 17 '22 06:01 pranshuthegamer

After removing the try-catch statement, I found the error:

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "main.py", line 48, in <module>
    fetch_answers(sys.argv[1])
  File "main.py", line 9, in fetch_answers
    uClient = ureq(my_url)
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Seems like this is not working anymore...

matthewknill avatar Oct 08 '22 04:10 matthewknill

After removing the try-catch statement, I found the error:

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Traceback (most recent call last):
  File "main.py", line 48, in <module>
    fetch_answers(sys.argv[1])
  File "main.py", line 9, in fetch_answers
    uClient = ureq(my_url)
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Seems like this is not working anymore...

I think Quora is rejecting the request and returning a HTTP Error 403: Forbidden response. You can get a 200 response by adding headers to the request. Like this:

from urllib.request import Request

def fetch_answers(my_url):
    req = Request(
            my_url, 
            data=None, 
            headers={
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'
            }
        )
    uClient = ureq(req)

chedychaaben avatar Mar 14 '23 23:03 chedychaaben