Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

fix needed after strip(\r) in _2_parse.py in version 0.19 and 2 more domains have : on the wring place in regex #246

Merged
merged 2 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@
failure = {}
nones = []


def prepItem(d):
print("-" * 80)
print(d)
Expand Down Expand Up @@ -463,4 +464,5 @@ def main():
for d in sorted(nones):
print(d)


main()
17 changes: 11 additions & 6 deletions whois/tld_regexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@

download = {
"extend": "amsterdam",
"name_servers": r"Name Server:\s*(.+)\r",
"name_servers": r"Name Server:[ \t]+(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
"status": r"Domain Status:\s*([a-zA-z]+)",
}

Expand Down Expand Up @@ -957,8 +957,13 @@
"creation_date": r"Creation Date:\s?(.+)",
"expiration_date": r"Expiration Date:\s?(.+)",
"updated_date": r"Modified Date:\s?(.+)",
"name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
"status": r"Domain Status:\s*(.*)\r\n",

# fix needed after strip(\r) in _2_parse.py in version 0.19
# "name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
"name_servers": r"Name Servers:(?:\s+(\S+))(?:\s+(\S+))?(?:\s+([\.\w]+)\s+)?",
# this seems ok for 2 and 3 ns and does not catch the dnssec: line

"status": r"Domain Status:\s*(.*)\r?\n",
# "emails": r"(\S+@\S+)",
"emails": r"[\w\.-]+@[\w\.-]+\.[\w]{2,4}",
}
Expand All @@ -970,7 +975,7 @@
"creation_date": r"Created:\s?(.+)",
"expiration_date": r"Valid Until:\s?(.+)",
"updated_date": r"Updated:\s?(.+)",
"name_servers": r"Nameserver:\s*(.+)\r",
"name_servers": r"Nameserver:\s*(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
"registrant": r"Contact:\s?(.+)",
"registrant_country": r"Country Code:\s?(.+)\nRegistrar:",
}
Expand Down Expand Up @@ -1689,7 +1694,7 @@
"registrar": r"Registrar:\s+(.+)",
"status": r"Domain status:\s(.+)",
"creation_date": r"Registration date:\s+(.+)",
"expiration_date": r":Expiration date\s+(.+)",
"expiration_date": r"Expiration date:\s+(.+)",
"updated_date": r"Modification date:\s+(.+)",
"name_servers": r"DNS:\s+(.+)",
"registrant_country": None,
Expand All @@ -1701,7 +1706,7 @@
"registrar": r"Registrar:\s+(.+)",
"domain_name": r"\s+Domain name:\s+(.+)",
"creation_date": r"\s+Creation Date:\s+(.+)",
"expiration_date": r":\s+Expiration Date\s+(.+)",
"expiration_date": r"\s+Expiration Date:\s+(.+)",
"updated_date": r"\s+Modified Date:\s+(.+)",
"status": r"\s+Domain Status:\s(.+)",
"registrant_country": None,
Expand Down