pseudonym117 / Riot-Watcher

Simple Python wrapper for the Riot Games API for League of Legends
MIT License
531 stars 150 forks source link

champion_master is outdated, updated from encrypted_summoner_id to puuid #232

Closed robbylew closed 4 months ago

robbylew commented 7 months ago

When trying to get champion mastery, it still asks for encrypted_summoner_id when the API now asks for puuid

When running:

lol_watcher.champion_mastery.by_summoner_by_champion('na1', 'b4rpqbmfbERhRH3cDPiPLhN0WW0Azxa8oc8jWEHWqqD7mzs', 105)

I get the error:

HTTPError: 403 Client Error: Forbidden for url: https://na1.api.riotgames.com/lol/champion-mastery/v4/champion-masteries/by-summoner/b4rpqbmfbERhRH3cDPiPLhN0WW0Azxa8oc8jWEHWqqD7mzs/by-champion/105

And after surveying the API it is noted that they updated to puuid (https://developer.riotgames.com/apis#champion-mastery-v4/GET_getChampionMasteryByPUUID)

So the correct request would be:

https://na1.api.riotgames.com/lol/champion-mastery/v4/champion-masteries/by-puuid/

instead of

https://na1.api.riotgames.com/lol/champion-mastery/v4/champion-masteries/by-summoner/

karlroush commented 5 months ago

Can confirm, it appears that this occurs in ChampionMasteryAPIV4 (https://riot-watcher.readthedocs.io/en/latest/riotwatcher/LeagueOfLegends/ChampionMasteryApiV4.html#riotwatcher._apis.league_of_legends.ChampionMasteryApiV4).

There's a couple other places where it's out of date as well.