From fc7e485f3370f3122cae4c8c4066403e984aa948 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 28 Aug 2023 14:11:50 +0200 Subject: [PATCH] Continued: - also need to break the loop when no 'data' element is being returned which might be the case when the server doesn't return a JSON --- fba/networks/peertube.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fba/networks/peertube.py b/fba/networks/peertube.py index 951e263..758c8dd 100644 --- a/fba/networks/peertube.py +++ b/fba/networks/peertube.py @@ -79,6 +79,9 @@ def fetch_peers(domain: str) -> list: if len(rows) < 100: logger.debug("Reached end of JSON response, domain='%s'", domain) break + else: + logger.warning("domain='%s' has no 'data' element returned - SKIPPED!", domain) + break # Continue with next row start = start + 100 -- 2.39.5