erjiang / valorant-mmr

Get your Valorant MMR with this Python script
MIT License
1 stars 0 forks source link

403 Forbidden Error #2

Open MichaelMarkieta opened 2 years ago

MichaelMarkieta commented 2 years ago

Not sure why I would be getting 403 errors here, its not related to username + password. Could there be an API key or grant required on the riot account level?

Traceback (most recent call last):
  File "C:\Users\marki\Documents\code\valorant-mmr\valorant_mmr3.py", line 143, in <module>
    main()
  File "C:\Users\marki\Documents\code\valorant-mmr\valorant_mmr3.py", line 133, in main
    cookie_jar = get_cookies(username, password)
  File "C:\Users\marki\Documents\code\valorant-mmr\valorant_mmr3.py", line 35, in get_cookies
    urllib.request.urlopen(req)
  File "C:\Python310\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python310\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Python310\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Python310\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Python310\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Python310\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
gavindegreen commented 2 years ago

I found this directly on (Riot Developer Portal):

403 (Forbidden) This error indicates that the server understood the request but refuses to authorize it. There is no distinction made between an invalid path or invalid authorization credentials (e.g., an API key). The client should not continue to make similar requests.

Common Reasons

MichaelMarkieta commented 2 years ago

I am guessing this tool doesn't work anymore. Just tested two different accounts, on both windows and linux, with the same 403 errors. Let me know if its working for you, and with what configuration (OS, version of python, etc)

gavindegreen commented 2 years ago

I figured it out. At least I think. I'm pretty sure it all stems down to the original creator's app api key being expired. The way the code is currently written, you would have to register an application with riot games and then replace the creator's app id with the app id for the app that you just registered. I hope all of that made sense.