diff --git a/src/auto_archiver/archivers/instagram_tbot_archiver.py b/src/auto_archiver/archivers/instagram_tbot_archiver.py index 55141ac..ee41247 100644 --- a/src/auto_archiver/archivers/instagram_tbot_archiver.py +++ b/src/auto_archiver/archivers/instagram_tbot_archiver.py @@ -31,7 +31,7 @@ class InstagramTbotArchiver(Archiver): "api_id": {"default": None, "help": "telegram API_ID value, go to https://my.telegram.org/apps"}, "api_hash": {"default": None, "help": "telegram API_HASH value, go to https://my.telegram.org/apps"}, "session_file": {"default": "secrets/anon-insta", "help": "optional, records the telegram login session for future usage, '.session' will be appended to the provided value."}, - "timeout": {"default": 15, "help": "timeout to fetch the instagram content in seconds."}, + "timeout": {"default": 45, "help": "timeout to fetch the instagram content in seconds."}, } def setup(self) -> None: @@ -52,9 +52,9 @@ class InstagramTbotArchiver(Archiver): attempts = 0 seen_media = [] message = "" - time.sleep(4) + 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 and (not message or not len(seen_media)): + while attempts < (self.timeout - 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):