From 73536fd27df0f28c3ab3e83e3e2c0991607c8e9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 2 Jun 2023 23:02:38 +0200 Subject: [PATCH] Continued: - Firfox version updated - also check if domain is already registered to avoid lots of requests --- config.defaults.json | 2 +- fetch_bkali.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config.defaults.json b/config.defaults.json index f6de1c0..bbce483 100644 --- a/config.defaults.json +++ b/config.defaults.json @@ -3,7 +3,7 @@ "log_level" : "info", "host" : "127.0.0.1", "port" : 8069, - "useragent" : "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0", + "useragent" : "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/113.0", "connection_timeout": 30, "read_timeout" : 5, "bot_enabled" : false, diff --git a/fetch_bkali.py b/fetch_bkali.py index f09612d..b245feb 100755 --- a/fetch_bkali.py +++ b/fetch_bkali.py @@ -36,10 +36,13 @@ try: print(f"WARNING: entry does not contain 'domain' - SKIPPED!") continue elif not validators.domain(entry["domain"]): - print(f"WARNING: domain='{entry['domain']}' is {entry['domain']}' is not a valid domain - SKIPPED!") + print(f"WARNING: domain='{entry['domain']}' is not a valid domain - SKIPPED!") continue elif fba.is_blacklisted(entry["domain"]): - # DEBUG: print(f"DEBUG: domain='blacklisted - SKIPPED!") + # DEBUG: print(f"DEBUG: domain='{entry['domain']}' is blacklisted - SKIPPED!") + continue + elif fba.is_instance_registered(entry["domain"]): + # DEBUG: print(f"DEBUG: domain='{entry['domain']}' is already registered - SKIPPED!") continue domains.append(entry["domain"]) -- 2.39.2