python - python riotwatcher 对 url 的错误请求
问题描述
我正在尝试从他的 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
解决方案
新的 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)
推荐阅读
- javascript - 刷新页面后的粗体活动菜单
- docker - 配置文件更改为 VerneMQ docker 映像
- spring - 为什么 Querydsl 总是要求连接是事务性的?
- android - 使用 Android 9(API 级别 28)连接到 wifi 网络
- laravel-5 - 在 fieldname=>fieldvalue 键中雄辩地获取数据
- c# - 如何在不影响行为的情况下处理表单中的 wndproc calcsize 进程进行自定义
- postgresql - postgres 10.1和hibernate的关系不存在错误
- c# - 无法从 OracleRefCursor 填充 DataTable
- python - 更改 %timeit 默认行为
- android - 应用内更新检查是 AppUpdateType.FLEXIBLE 还是 AppUpdateType.IMMEDIATE