I'm trying to develop a service that listens for Twitch subscribe events (through its API) and gifts chests to the user that subscribed. Twitch allows me to get an auth token for the user and get a new one everytime it expires, so that part is covered. The problem is that Streamloots doesnt have a fully functional API, and I need the Streamloots token to gift the chest. When a user is logged into Twitch, you can get a Streamloots auth token just by clicking a button (Log in with twitch). Then streamloots asks for the auth token of the user using its client_id token, which Twitch grants. I was considering on simulating that button click this way:
- Use the user auth token generated through the Twitch API and making a request with the proper cookie.
- Getting redirected to Streamloots with the newly created session and grabbing the STreamloots token through the cookies.
The problem: Twitch knows the user token was created through an external APP, and not through its webpage login, so it isnt a valid website auth token. Therefore I cant generate a Streamloots token everytime it expires, so my app is pointless. I tried several ways of doing so, even using Puppetteer to simulate the user logging into Twitch. The problem with this approach is that I'm planning to set this up on an AWS computer, so resources are valuable. Besides that, Twitch asks for validation codes and captchas when detecting weird stuff, so it could be even more problematic.
¿Any ideas? I'm not providing code because I dont think it really matters for this kind of question. I could be wrong so just let me know.
P.S.: Streamloots KIND OF has an API, but the login is not working.