I’m trying to set stream title, going as follows:
#Get access token
url = "https://api.twitch.tv/kraken/oauth2/token?client_id="+CLIENT_ID+"&client_secret=MY_CLIENT_SECRET&grant_type=client_credentials&scope=user:edit"
req = requests.post(url)
#Send request using token
url = "https://api.twitch.tv/kraken/channels/mychannel/"
headers = {"Client-ID" : ""+CLIENT_ID +"",
"Accept" : "application/vnd.twitchtv.v5+json",
"Authorization" : "OAuth "+json.loads(req.text)['access_token'],
"Content-Type": "application/json"
}
data = {"channel": {"status": tmp, "channel_feed_enabled": 'true'}}
resp = requests.put(url=url, data=data, headers=headers)
print(resp) //prints <Response[500]>
I don’t get what I’m doing wrong. Already tried withNew Twitch API changing OAuth with Bearer with no success. Can someone explain me what’s going on?