From 15d127bedd208d11bbd24159be346a507d6914e4 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Fri, 7 Jan 2022 22:41:37 +0100 Subject: [PATCH] Watch restart after claiming drop adjustment --- twitch.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/twitch.py b/twitch.py index bc1cf2f..acb82c2 100644 --- a/twitch.py +++ b/twitch.py @@ -420,10 +420,11 @@ class Twitch: if not mined or campaign.remaining_drops == 0: self.change_state(State.INVENTORY_FETCH) return - # About 4-6s after claiming the drop, next drop can be started - # by re-sending the watch payload + # About 4-20s after claiming the drop, next drop can be started + # by re-sending the watch payload. We can test for it by fetching the current drop + # via GQL, and then comparing drop IDs. await asyncio.sleep(4) - for attempt in range(6): + for attempt in range(8): context = await self.gql_request(GQL_OPERATIONS["CurrentDrop"]) drop_data: JsonType = context["data"]["currentUser"]["dropCurrentSession"] with open("log.txt", 'a') as file: @@ -431,7 +432,7 @@ class Twitch: if drop_data["dropID"] != drop.id: self.restart_watching() break - await asyncio.sleep(1) + await asyncio.sleep(2) return assert msg_type == "drop-progress" if self._drop_update is None: