From c90a7e42ab344e4dea7702a93e85bc878c7c3801 Mon Sep 17 00:00:00 2001 From: nanos Date: Thu, 3 Aug 2023 15:21:59 +0100 Subject: [PATCH] fix incorrect rate limit handling for mastodon --- find_posts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find_posts.py b/find_posts.py index d697349..0a8ad0b 100644 --- a/find_posts.py +++ b/find_posts.py @@ -738,7 +738,7 @@ def get_mastodon_urls(webserver, toot_id, toot_url): reset = datetime.strptime(resp.headers['x-ratelimit-reset'], '%Y-%m-%dT%H:%M:%S.%fZ') log(f"Rate Limit hit when getting context for {toot_url}. Waiting to retry at {resp.headers['x-ratelimit-reset']}") time.sleep((reset - datetime.now()).total_seconds() + 1) - return get_toot_context(server, toot_id, toot_url, seen_hosts) + return get_mastodon_urls(webserver, toot_id, toot_url) log( f"Error getting context for toot {toot_url}. Status code: {resp.status_code}"