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

Commit 8af35bc

Browse files
author
MooCow
authored
Merge pull request #246 from maarten-boot/master
fix needed after strip(\r) in _2_parse.py in version 0.19 and 2 more domains have : on the wring place in regex
2 parents 86506f9 + d2a7db1 commit 8af35bc

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@
356356
failure = {}
357357
nones = []
358358

359+
359360
def prepItem(d):
360361
print("-" * 80)
361362
print(d)
@@ -463,4 +464,5 @@ def main():
463464
for d in sorted(nones):
464465
print(d)
465466

467+
466468
main()

whois/tld_regexpr.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368

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

@@ -957,8 +957,13 @@
957957
"creation_date": r"Creation Date:\s?(.+)",
958958
"expiration_date": r"Expiration Date:\s?(.+)",
959959
"updated_date": r"Modified Date:\s?(.+)",
960-
"name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
961-
"status": r"Domain Status:\s*(.*)\r\n",
960+
961+
# fix needed after strip(\r) in _2_parse.py in version 0.19
962+
# "name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
963+
"name_servers": r"Name Servers:(?:\s+(\S+))(?:\s+(\S+))?(?:\s+([\.\w]+)\s+)?",
964+
# this seems ok for 2 and 3 ns and does not catch the dnssec: line
965+
966+
"status": r"Domain Status:\s*(.*)\r?\n",
962967
# "emails": r"(\S+@\S+)",
963968
"emails": r"[\w\.-]+@[\w\.-]+\.[\w]{2,4}",
964969
}
@@ -970,7 +975,7 @@
970975
"creation_date": r"Created:\s?(.+)",
971976
"expiration_date": r"Valid Until:\s?(.+)",
972977
"updated_date": r"Updated:\s?(.+)",
973-
"name_servers": r"Nameserver:\s*(.+)\r",
978+
"name_servers": r"Nameserver:\s*(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
974979
"registrant": r"Contact:\s?(.+)",
975980
"registrant_country": r"Country Code:\s?(.+)\nRegistrar:",
976981
}
@@ -1689,7 +1694,7 @@
16891694
"registrar": r"Registrar:\s+(.+)",
16901695
"status": r"Domain status:\s(.+)",
16911696
"creation_date": r"Registration date:\s+(.+)",
1692-
"expiration_date": r":Expiration date\s+(.+)",
1697+
"expiration_date": r"Expiration date:\s+(.+)",
16931698
"updated_date": r"Modification date:\s+(.+)",
16941699
"name_servers": r"DNS:\s+(.+)",
16951700
"registrant_country": None,
@@ -1701,7 +1706,7 @@
17011706
"registrar": r"Registrar:\s+(.+)",
17021707
"domain_name": r"\s+Domain name:\s+(.+)",
17031708
"creation_date": r"\s+Creation Date:\s+(.+)",
1704-
"expiration_date": r":\s+Expiration Date\s+(.+)",
1709+
"expiration_date": r"\s+Expiration Date:\s+(.+)",
17051710
"updated_date": r"\s+Modified Date:\s+(.+)",
17061711
"status": r"\s+Domain Status:\s(.+)",
17071712
"registrant_country": None,

0 commit comments

Comments
 (0)