tbot archiver works

pull/74/head
msramalho 2023-05-02 19:04:51 +01:00
rodzic 567edfc35e
commit 9191b38cf2
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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):