meraki-analytics / cassiopeia

An all-inclusive Python framework for the Riot Games League of Legends API. Cass focuses on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.
MIT License
553 stars 134 forks source link

ACCOUNT-V1 seems to be using the wrong region for PH. #451

Closed CarlVictorV closed 6 months ago

CarlVictorV commented 6 months ago
import cassiopeia as cass
from cassiopeia import Account

def print_summoner(name: str, tagline: str, region: str):
    account = Account(
        name=name,
        tagline=tagline,
        region=region,
    )
    summoner = account.summoner
    print(summoner)

if __name__ == "__main__":
    print_summoner("Pobelter", "NA1", "NA") #Americas
    print_summoner("Kalturi", "NA1", "NA") #Americas
    print_summoner("Kaiser10", "JP1", "JP") #Asia
    print_summoner("KaiserV", "GOW", "PH") #SEA
    print_summoner("Omega", "SG2", "SG") #SEA
    #SEA is not a correct region for accounts-v1

After testing out Cassiopeia, I realized that it does not work for the Philippines or Southeast Asia regions.

Making call: https://asia.api.riotgames.com/riot/account/v1/accounts/by-riot-id/Kaiser10/JP1
Summoner(id=?, account_id=?, puuid='T62kOSc4Gj4mUSty2hNLTkXzU0GTOJC6hAX1FrMkElhNJW_STobine2AQ8lLusIHFyPv5ywnKTeULA')
Making call: https://sea.api.riotgames.com/riot/account/v1/accounts/by-riot-id/KaiserV/GOW
Traceback (most recent call last):
.... errors

It uses 'sea' even though it's not a valid choice for account/v1.

jjmaldonis commented 6 months ago

Thanks for the report and the code to reproduce. This is now fixed in version 5.1.2