From c222d63383961583912bc6a5c2de0216daf1628f Mon Sep 17 00:00:00 2001 From: Maarten Boot <11140490+maarten-boot@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:02:44 +0100 Subject: [PATCH 1/3] fix by kazan for pl tld to fix missing expire date --- whois/tldDb/tld_regexpr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/whois/tldDb/tld_regexpr.py b/whois/tldDb/tld_regexpr.py index c33814b..2d2c475 100644 --- a/whois/tldDb/tld_regexpr.py +++ b/whois/tldDb/tld_regexpr.py @@ -735,9 +735,13 @@ def xStr(what: str, times: int = 1, firstMandatory: bool = True) -> str: "registrar": R(r"\nREGISTRAR:\s*(.+)\n"), "creation_date": R(r"\ncreated:\s*(.+)\n"), "updated_date": R(r"\nlast modified:\s*(.+)\n"), - "expiration_date": R(r"\noption expiration date:\s*(.+)\n"), + # "expiration_date": R(r"\noption expiration date:\s*(.+)\n"), + # If no "option expiration date:" is present, use "renewal date:", but only + # if it's not not followed by "option expiration date:". google.pl is the test case here + "expiration_date": R(r"(?:\noption expiration date:|renewal date:(?!(?:.|\n)*\noption expiration date:))\s*(.+)\n"), "name_servers": R(r"nameservers:%s" % xStr(r"(?:\s+(\S+)[^\n]*\n)?", 4)), "status": R(r"\nStatus:\n\s*(.+)"), + "_test": "google.pl", } ZZ["pt"] = { From 557a013ef790d8e736369539e61d3bb19f352d6d Mon Sep 17 00:00:00 2001 From: Maarten Boot <11140490+maarten-boot@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:15:57 +0100 Subject: [PATCH 2/3] update make test --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 636363a..d089424 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ reformat: ./reformat-code.sh test: - ./test2.py -d google.com + ./test2.py -t 2>2 | tee 1 build: python -m build From 94570747524e7ace061c365d90538ff8ef0cf67f Mon Sep 17 00:00:00 2001 From: Maarten Boot <11140490+maarten-boot@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:30:02 +0100 Subject: [PATCH 3/3] update test whl --- testwhl.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/testwhl.py b/testwhl.py index 6f15eab..18c73ab 100644 --- a/testwhl.py +++ b/testwhl.py @@ -1,5 +1,10 @@ import whois -domain = "google.com" -d = whois.query(domain, verbose=True) -print(d.__dict__) +for tld in whois.validTlds(): + hint = whois.getTestHint(tld) + if hint: + print(f"# == {hint}") + d = whois.query(hint, verbose=True) + for k,v in d.__dict__.items(): + print(f"\t{k}\t{v}") + print("")