From 3094e8fe2ded722093eb73b5b2e0addfe5295bfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 19 May 2023 21:35:04 +0200 Subject: [PATCH] Continued: - need to check if current "step"'s entries are lesser than expected to break out loop --- fba.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fba.py b/fba.py index f19c108..9eefe74 100644 --- a/fba.py +++ b/fba.py @@ -328,6 +328,10 @@ def get_misskey_blocks(domain: str) -> dict: } ) + if len(doc) < step: + # NOISY-DEBUG: print("DEBUG: End of request:", len(doc), step) + break + # NOISY-DEBUG: print("DEBUG: Raising counter by step:", step) counter = counter + step @@ -368,6 +372,12 @@ def get_misskey_blocks(domain: str) -> dict: "domain": instance["host"], "reason": "" }) + + if len(doc) < step: + # NOISY-DEBUG: print("DEBUG: End of request:", len(doc), step) + break + + # NOISY-DEBUG: print("DEBUG: Raising counter by step:", step) counter = counter + step except: -- 2.39.5