frissyn / valorant.py

Complete Python interface for the Valorant API. Works right out of the box!
https://valorantpy.readthedocs.io
MIT License
125 stars 19 forks source link

Bad Request at initialize #16

Closed eve-alt closed 3 years ago

eve-alt commented 3 years ago
  File "C:\Users\Lu\AppData\Local\Programs\Python\Python39\lib\site-packages\valorant\client.py", line 37, in __init__
    self.reload()
  File "C:\Users\Lu\AppData\Local\Programs\Python\Python39\lib\site-packages\valorant\client.py", line 58, in reload
    r.raise_for_status()
  File "C:\Users\Lu\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://na.api.riotgames.com/val/content/v1/contents?locale=en-PH
frissyn commented 3 years ago

@eve-alt

Try initializing the Client with locale set to None, something might've changed with the locale getter. Could you also share the code snippet you're running? I'll look into it later today.

eve-alt commented 3 years ago

After doing some trial and error yesterday, I figured out it was constructing it's own locale based on my region I think? So I manually set a valid local on the Client constructor. My bad, this is not really an issue but thanks for replying!

frissyn commented 3 years ago

@eve-alt All good, glad you could sort it out!