From a458460cec77aceefdcd9b966e5c1813ea16c883 Mon Sep 17 00:00:00 2001 From: Georg Date: Thu, 26 Aug 2021 16:58:04 +0200 Subject: Adding option for sample IP Signed-off-by: Georg --- plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugin.py') diff --git a/plugin.py b/plugin.py index 39e2457..10eddb5 100644 --- a/plugin.py +++ b/plugin.py @@ -85,7 +85,7 @@ class SnoParser(callbacks.Plugin): asn = whoisres['asn_registry'] country = whoisres['asn_country_code'] description = whoisres['asn_description'] - whoisout = 'WHOIS ' + asn + ' ' + country + ' ' + description + whoisout = '# ' + asn + ' ' + country + ' ' + description except ipwhois.exceptions.IPDefinedError: whoisout = 'RFC 4291 (Local)' @@ -124,7 +124,7 @@ class SnoParser(callbacks.Plugin): print("DEBUG - ELSE WHOIS_FRESH CALLED") print(data) print(sourceip) - if data.startswith("WHOIS"): + if data.startswith("#"): #data["cache"] = False print("DEBUG - CACHE: FALSE") data = json.dumps(data) @@ -167,8 +167,10 @@ class SnoParser(callbacks.Plugin): nickname = couple.group(1) username = couple.group(2) host = couple.group(3) - #ip = couple.group(4) - ip = '2a03:4000:55:d20::' + if self.registryValue('whois.sample'): + ip = self.registryValue('whois.sample') + else: + ip = couple.group(4) realname = couple.group(5) ip_seen = 0 nick_seen = 0 -- cgit v1.2.3