Twitch api访问令牌问题

2024-05-20 00:01:11 发布

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

目前我正在尝试使用twitch api

我成功地接收了我的访问令牌,但是每当我尝试在twitch api中执行任何其他操作时,它都会说它是错误的

headers = {
'Authorization': 'Bearer wejrwjre334',
'Client-Id': 'w9eii2',
}

params = (
('first', gamelimit),
)

a = requests.get('https://api.twitch.tv/helix/games/top', headers=headers,  params=params).content()
print(a)

我得到这个错误: File "C:/Users/myalt/OneDrive/Desktop/pythonProject1/main.py", line 26, in <module> a = requests.get('https://api.twitch.tv/helix/games/top', headers=headers, params=params).content() TypeError: 'bytes' object is not callable

当我点击链接:{“error”:“Unauthorized”,“status”:401,“message”:“OAuth令牌丢失”}

任何帮助都将非常感激


Tags: httpsapigettop错误paramscontenttv