python riotwatcher对url的错误请求

2024-10-02 22:32:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从一个玩家的puuid访问他的匹配列表,但是当我执行代码时,我得到一个错误。。。为什么会发生这种错误?我有正确的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

Tags: 代码fromhttpsimportcom列表match错误
1条回答
网友
1楼 · 发布于 2024-10-02 22:32:06

新的match_v5使用了一种新类型的区域intead,例如“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)

相关问题 更多 >