From fb56aac15e51a7151cb671a6d0f0d2dc3e01b3de Mon Sep 17 00:00:00 2001 From: erinhmclark Date: Fri, 7 Mar 2025 11:24:25 +0000 Subject: [PATCH] Catch edge case to ensure iterator is reached in instagram_tbot_extractor.py --- .../instagram_tbot_extractor/instagram_tbot_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auto_archiver/modules/instagram_tbot_extractor/instagram_tbot_extractor.py b/src/auto_archiver/modules/instagram_tbot_extractor/instagram_tbot_extractor.py index 4404d07..1416da9 100644 --- a/src/auto_archiver/modules/instagram_tbot_extractor/instagram_tbot_extractor.py +++ b/src/auto_archiver/modules/instagram_tbot_extractor/instagram_tbot_extractor.py @@ -104,7 +104,7 @@ class InstagramTbotExtractor(Extractor): message = "" time.sleep(3) # media is added before text by the bot so it can be used as a stop-logic mechanism - while attempts < (self.timeout - 3) and (not message or not len(seen_media)): + while attempts < max(self.timeout - 3, 3) and (not message or not len(seen_media)): attempts += 1 time.sleep(1) for post in self.client.iter_messages(chat, min_id=since_id):