From cb5db158ec1f3ca94d5138aa710b1787be5aec4c Mon Sep 17 00:00:00 2001 From: DevilXD Date: Thu, 16 Dec 2021 19:30:56 +0100 Subject: [PATCH] Use a more sane live streams limit --- twitch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/twitch.py b/twitch.py index 9a7beb7..f070c34 100644 --- a/twitch.py +++ b/twitch.py @@ -28,6 +28,8 @@ from constants import ( GQL_OPERATIONS, DROPS_ENABLED_TAG, TERMINATED_STR, + MAX_WEBSOCKETS, + WS_TOPICS_LIMIT, GQLOperation, ) @@ -431,7 +433,7 @@ class Twitch: async def get_live_streams( self, games: Collection[Game], tag_ids: List[str] ) -> Dict[Game, List[Channel]]: - limit = 100 + limit = min(int((MAX_WEBSOCKETS * WS_TOPICS_LIMIT) // len(games)), 100) live_streams = {} for game in games: response = await self.gql_request(