I want to automate the changing of Twitch game category because it’s tedious having to click and type in a lookup field every time I change games, and I change games at least 2 or 3 times every stream. I’m sure this is a common nuisance for streamers.
It looks like I could probably automate this using OBS, upon scene change call curl to access the Twitch API via a batch script of some kind.
I looked up previous answers on this topic, but I’m confused about how curl is used to authenticate to get a token, so it can then do the PUT request to change channel game property.
I found the reference here, and I registered an application to get a Client ID to use.
curl -H 'Client-ID: XXXXXX' \
-H 'Accept: application/vnd.twitchtv.v5+json' \
-H 'Authorization: OAuth YYYYYY' \ -d 'channel[game]=Mordhau' \
-X PUT 'https://api.twitch.tv/kraken/channels/ZZZZZZ'
If I simplify the example in the documentation to just set the game category, it would look similar to above. Though I don’t understand how I get the OAuth token.
XXXXXX - Client ID, I registered an application, and I used http://localhost as the endpoint URL which is hopefully OK for this purpose?
YYYYYY - I couldn’t get my head around the OAuth documentation. Maybe I need to do an authentication request to get an OAuth token?
ZZZZZZ - For the channel ID is it OK to use the twitch username? Or would I need to do another GET to look up my channel ID first, and plug that into my statements?
I’m using Windows 64bit curl in case that has any impact on the command syntax. If someone familiar with curl and the twitch API could comment an example of how to authenticate, and update the game category it would be of much help.
If the above is not possible or suitable, my suggestion would be at the least, Twitch game category dialog should show recently used game categories for the user, or allow them to set a list of common categories to choose from. Having to type and search each time is annoying enough it drove me here