python riotwatch错误的url请求



我试图访问一个球员的比赛列表从他的液体,但当我执行我的代码,我得到一个错误…为什么会发生这个错误?我有正确的RiotApiKey,和正确的player_puuid,因为当我从https://developer.riotgames.com/apis#match-v5/GET_getMatchIdsByPUUID执行请求时,它工作并返回给我匹配列表,我找不到为什么这个简单的任务不工作。谢谢你的帮助

我代码:

from riotwatcher import LolWatcher
from settings import RiotKey,riotApiRegion,player_puuid
watcher = LolWatcher(RiotKey)
matches = watcher.match.matchlist_by_puuid(riotApiRegion,player_puuid)

然后我得到这个错误:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://euw1.api.riotgames.com/lol/match/v5/matches/by-puuid/RGAPI-a65424c1-2e67-44b0-97f5-0179453c3f5e/ids

新的match_v5使用了新的区域类型,而不是"euw1"比如现在是"欧洲"。

old = ["na1", "euw1", "eun1", "kr", "br1", "jp1", "ru", "oc1", "tr1", "la1", "la2"]
new = ["europe", "asia", "americas"]
from riotwatcher import LolWatcher
from settings import RiotKey,riotApiRegion,player_puuid
watcher = LolWatcher(RiotKey)
matches = watcher.match.matchlist_by_puuid("europe", player_puuid)

最新更新