Skip to content

Eventsub/webhook support #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Serph91P opened this issue Dec 25, 2024 · 8 comments
Open

Eventsub/webhook support #560

Serph91P opened this issue Dec 25, 2024 · 8 comments

Comments

@Serph91P
Copy link

Serph91P commented Dec 25, 2024

Hey, would be great if you could add eventsub support. I know it requires a valid https certificate but this would greatly improve the application since this will get near to instant notification for a Livestream to start or any change made to the stream. So you could get alot more metadata faster and more precise.

Webhook since multiple streamers.

Maybe you can have a look.

https://dev.twitch.tv/docs/eventsub/
https://dev.twitch.tv/docs/eventsub/handling-webhook-events/

@russelg
Copy link

russelg commented Dec 25, 2024

One project that implements this is https://github.com/MrBrax/LiveStreamDVR, and I still use this just for live notifications for my own purposes. Also useful as it captures game and stream title changes.

@Serph91P
Copy link
Author

One project that implements this is https://github.com/MrBrax/LiveStreamDVR, and I still use this just for live notifications for my own purposes. Also useful as it captures game and stream title changes.

Thank you. I already use this but the dev has no time to maintain at the moment and it has this wiered ram issue if you have some streams accumulated.

@russelg
Copy link

russelg commented Dec 25, 2024

Sorry, only pointed the repo out as reference for a project which implements using these webhooks.

@Serph91P
Copy link
Author

Sorry, only pointed the repo out as reference for a project which implements using these webhooks.

Still thankful and am sorry if I was rude slept kinda bad.

@Zibbp
Copy link
Owner

Zibbp commented Dec 25, 2024

It should be possible to use the websockets from the eventsub API. Originally I believe this feature only supported webhooks which is why I never implemented it as that would require exposing your instance publicly.

@Serph91P
Copy link
Author

Serph91P commented Dec 25, 2024

It should be possible to use the websockets from the eventsub API. Originally I believe this feature only supported webhooks which is why I never implemented it as that would require exposing your instance publicly.

You need webhooks for it to support multiple streamers. And Eventsub needs https to work. You could add a restricitoin for it to work the reverse proxy is needed.

https://pytwitchapi.dev/en/stable/modules/twitchAPI.eventsub.html

@Zibbp
Copy link
Owner

Zibbp commented Dec 27, 2024

I don't want to implement the webhook version as that would require having your Ganymede instance publicly available. This is not something I want to require.

The websocket eventsub would work, but I see an immediate issue. Each "subscription" to an event costs points. Websockets have a max limit of 10 "cost" per subscription.

The max_total_cost is 10 across all subscriptions.
https://dev.twitch.tv/docs/eventsub/manage-subscriptions/

A stream going live notification costs 1, so a max of 10 watched channels.

stream.online (no auth requirements, cost 1)
https://dev.twitch.tv/docs/eventsub/manage-subscriptions/

So using eventsub would limit the number of live watched channels to 10 which is not great. Unless I'm missing something about the eventsub API?

@Serph91P
Copy link
Author

Serph91P commented Dec 27, 2024

I don't want to implement the webhook version as that would require having your Ganymede instance publicly available. This is not something I want to require.

The websocket eventsub would work, but I see an immediate issue. Each "subscription" to an event costs points. Websockets have a max limit of 10 "cost" per subscription.

The max_total_cost is 10 across all subscriptions.
https://dev.twitch.tv/docs/eventsub/manage-subscriptions/

A stream going live notification costs 1, so a max of 10 watched channels.

stream.online (no auth requirements, cost 1)
https://dev.twitch.tv/docs/eventsub/manage-subscriptions/

So using eventsub would limit the number of live watched channels to 10 which is not great. Unless I'm missing something about the eventsub API?

yeah but cant the user decide itself? Make it an option not an requirement. You could implement all 3, and make the user choose what he wants. Like api you can have unlimited but only poll every set time. Websocket instant notification but only 10 streams. Webhook unlimited and instant but needs to be public.

Oh and websocket gets worse in my opinion: https://dev.twitch.tv/docs/eventsub/manage-subscriptions/#subscription-limits
WebSocket limits

The following limits apply per user token (client ID and user ID tuple).

You may create a maximum of 3 WebSockets connections with enabled subscriptions. Reconnecting using a reconnection URL (see [Reconnect message](https://dev.twitch.tv/docs/eventsub/handling-websocket-events#reconnect-message)) doesn’t add to your WebSocket count.
Each WebSocket connection may create a maximum of 300 enabled subscriptions (disabled subscriptions don’t count against the limit).
The max_total_cost is 10 across all subscriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants