Skip to content

Commit

Permalink
[Streams] Switch to Twitch's newer follower endpoint (#6247)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlsbjorn authored Sep 6, 2023
1 parent d844c6f commit 64deccf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions redbot/cogs/streams/streamtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
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"
Expand Down Expand Up @@ -403,7 +403,9 @@ async def is_online(self):
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"]

Expand Down

0 comments on commit 64deccf

Please sign in to comment.