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 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("") diff --git a/whois/tldDb/tld_regexpr.py b/whois/tldDb/tld_regexpr.py index 3f387b8..dd367f4 100644 --- a/whois/tldDb/tld_regexpr.py +++ b/whois/tldDb/tld_regexpr.py @@ -736,7 +736,7 @@ def xStr(what: str, times: int = 1, firstMandatory: bool = True) -> str: "creation_date": R(r"\ncreated:\s*(.+)\n"), "updated_date": R(r"\nlast modified:\s*(.+)\n"), # If no "option expiration date:" is present, use "renewal date:", but only - # if it's not not followed by "option expiration date:". + # 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*(.+)"),