From 64deccff5f42712e630a9f7372bf76c8cb0382a0 Mon Sep 17 00:00:00 2001 From: Karlo Prikratki Date: Wed, 6 Sep 2023 20:41:35 +0200 Subject: [PATCH] [Streams] Switch to Twitch's newer follower endpoint (#6247) --- redbot/cogs/streams/streamtypes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/redbot/cogs/streams/streamtypes.py b/redbot/cogs/streams/streamtypes.py index e6ac344ad..c95a05b5b 100644 --- a/redbot/cogs/streams/streamtypes.py +++ b/redbot/cogs/streams/streamtypes.py @@ -27,7 +27,7 @@ from redbot.core.utils.chat_formatting import humanize_number, humanize_timedelt TWITCH_BASE_URL = "https://api.twitch.tv" TWITCH_ID_ENDPOINT = TWITCH_BASE_URL + "/helix/users" TWITCH_STREAMS_ENDPOINT = TWITCH_BASE_URL + "/helix/streams/" -TWITCH_FOLLOWS_ENDPOINT = TWITCH_ID_ENDPOINT + "/follows" +TWITCH_FOLLOWS_ENDPOINT = TWITCH_BASE_URL + "/helix/channels/followers" YOUTUBE_BASE_URL = "https://www.googleapis.com/youtube/v3" YOUTUBE_CHANNELS_ENDPOINT = YOUTUBE_BASE_URL + "/channels" @@ -403,7 +403,9 @@ class TwitchStream(Stream): final_data["title"] = stream_data["title"] final_data["type"] = stream_data["type"] - __, follows_data = await self.get_data(TWITCH_FOLLOWS_ENDPOINT, {"to_id": self.id}) + __, follows_data = await self.get_data( + TWITCH_FOLLOWS_ENDPOINT, {"broadcaster_id": self.id} + ) if follows_data: final_data["followers"] = follows_data["total"]