facundobatista / kilink

A next generation pastebin
GNU General Public License v3.0
25 stars 30 forks source link

urllib.error.HTTPError: HTTP Error 403: Forbidden #143

Closed RaSan147 closed 4 months ago

RaSan147 commented 3 years ago

I was trying to create a new paste and followed the steps of api section in the linkode site using py 3.7 but failed on line 4 u = request.urlopen("http://linkode.org/api/1/linkodes/", data=raw)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python37-32\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python37-32\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "C:\Python37-32\lib\urllib\request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python37-32\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "C:\Python37-32\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Python37-32\lib\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

can you guys help here or should i switch to requests and use a fake header?

facundobatista commented 4 months ago

Oh, I'm very sorry, totally missed this bug. :( Please reopen if you still with the same problem (surely not, sorry sorry again)