floxay / python-riot-auth

A Python 3 library to get various Riot tokens and get around Cloudflare's filter during auth.
MIT License
69 stars 16 forks source link

403 Error! #28

Closed ndzin closed 4 weeks ago

ndzin commented 1 month ago

I use the code from this repo for my discord bot that fetches my VALORANT Item Shop for me when it updates and also other features.

The thing is, after some time using it it started returning 403 every single time, and I just cant use it now. Perhaps is there a temporary fix around it or is it because of my IP address using it too much?

aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://auth.riotgames.com/api/v1/authorization')

Here's how my code has been written:

class Riot:
    def __init__(self, FS, region) -> None:
        self.fs = FS
        self.session = requests.Session()
        self.auth = riot_auth.RiotAuth()
        self.region = region.upper()
        self._initialize()

    def _initialize(self) -> None:
        self.base_endpoint = self.fs.config['riot']['base_urls']['base_endpoint'][self.region]

        self.session.headers['X-Riot-ClientPlatform'] = base64.b64encode(json.dumps(self.fs.config['riot']['headers']['client_platform']).encode())
        self.session.headers['X-Riot-ClientVersion'] = base64.b64encode(self.fs.config['riot']['headers']['client_version'].encode())       
floxay commented 4 weeks ago

Should be fixed with v1.0.7 (until Rito breaks it again.)