FrozenTear7 / twitch-spambot

An automated twitch spam user
MIT License
33 stars 11 forks source link

Cache TwitchEmotes to rely on rather than erroring #18

Closed JZomDev closed 2 years ago

JZomDev commented 3 years ago

Currently https://api.twitchemotes.com/api/v4/channels end point is down but the other ones work just fine.

If there was a way to save the emotes to a json file and read from it upon failure to GET from the uri, that would be great.

image

Unless it's blocking based on my IP for abuse? Not sure what the limit is, I been testing a lot with some things.

FrozenTear7 commented 3 years ago

Just to clarify the correct endpoint is https://api.twitchemotes.com/api/v4/channels/<channel_id>. It came out in #16 that their services go down from time to time so you usually need to wait a moment and restart the script for the bot to run properly. I'm against the idea of caching emotes since channels that I participate in usually update BTTV/FFZ emotes every day and I don't want to use outdated info.

Also no idea about the limit rates, this bot was intended for one person chat participation, so if you're planning to use it with multiple accounts you're kind of left on your own.

Feel free to fork the repo and implement caching on your own, but I don't plan on adding this feature to the official release, thank you for the contribution though.

ghost commented 3 years ago

The endpoint is still down for me. I've tried to run the spambot several times during the last couple of weeks with no success (404). Is an update coming anytime soon, or is this discontinued? Thank you for your work, nonetheless.

FrozenTear7 commented 3 years ago

Now that twitchemotes.com API is pretty much dead we have to start using the official Twitch API, I don't think there's a good alternative. Since this bot doesn't use the classic server-client architecture it creates a problem how to authorize requests to the Twitch API. The new Helix API uses the OAuth 2.0 flow, which we can't really use here, the only option I see for now is to authorize the requests with the OAuth token you get from TMI and a Client ID you can get by requesting the old (Kraken v5) API, but this won't last for long, since the migration started some time ago.

I'll try to post an updated version in the upcoming days, but it's not gonna work forever.

FrozenTear7 commented 2 years ago

Now fixed the new Twitch API emotes fetching.