python riotwatcher 对 url 的错误请求

python riotwatcher bad request for url

我正在尝试从他的 puuid 访问玩家的匹配列表,但是当我执行我的代码时,出现错误...为什么会发生此错误?我有正确的 RiotApiKey 和正确的 player_puuid 因为当我执行来自 https://developer.riotgames.com/apis#match-v5/GET_getMatchIdsByPUUID 的请求时它有效并且 returns 我是匹配列表,我无法找到为什么这个简单的任务不起作用。 感谢您的帮助

我的代码:

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)