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

Commit e385859

Browse files
author
MooCow
authored
Merge pull request #247 from maarten-boot/master
add tld's: page, observer, mk, green , africa, mn
2 parents 8af35bc + 0f7ce3e commit e385859

File tree

3 files changed

+120
-6
lines changed

3 files changed

+120
-6
lines changed

whois/_2_parse.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ def handleShortResponse(
123123
# NOTE: from here s is lowercase only
124124
# ---------------------------------
125125
noneStrings = [
126+
"no matching record",
126127
"not found",
128+
"no data found",
127129
"no entries found",
128130
"status: free",
129131
"no such domain",

whois/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
SLOW_DOWN = 0
4747

4848
Map2Underscore = {
49+
".co.za": "co_za", # south africa
50+
".web.za": "web_za", # south africa
51+
".org.za": "org_za", # south africa
52+
".net.za": "net_za", # south africa
53+
#
54+
".com.eg": "com_eg", # egypt
4955
".ac.uk": "ac_uk",
5056
".co.uk": "co_uk",
5157
".co.il": "co_il",
@@ -83,6 +89,8 @@
8389
".net.tr": "net_tr",
8490
#
8591
".edu.ua": "edu_ua",
92+
".com.ua": "com_ua",
93+
".net.ua": "net_ua",
8694
".lviv.ua": "lviv_ua",
8795
# dynamic dns without whois
8896
".hopto.org": "hopto_org",

whois/tld_regexpr.py

Lines changed: 110 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:[ \t]+(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
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

@@ -676,7 +676,7 @@
676676
"extend": "biz",
677677
"creation_date": r"Creation Date:\s?(.+)",
678678
"expiration_date": r"Expiry Date:\s?(.+)",
679-
"updated_date": r"Updated Date:\s?(.+)",
679+
"updated_date": None, # some entries have no date string but not always
680680
"name_servers": r"Name Server:\s*(\S+)\r?\n",
681681
"status": r"Domain Status:\s?(.+)",
682682
}
@@ -957,12 +957,10 @@
957957
"creation_date": r"Creation Date:\s?(.+)",
958958
"expiration_date": r"Expiration Date:\s?(.+)",
959959
"updated_date": r"Modified Date:\s?(.+)",
960-
961960
# fix needed after strip(\r) in _2_parse.py in version 0.19
962961
# "name_servers": r"Name Servers:\r\n(?:\s*(\S+)[ \t\r]*\n)(?:\s*(\S+)[ \t\r]*\n)?(?:\s*(\S+)[ \t\r]*\n)?",
963962
"name_servers": r"Name Servers:(?:\s+(\S+))(?:\s+(\S+))?(?:\s+([\.\w]+)\s+)?",
964963
# this seems ok for 2 and 3 ns and does not catch the dnssec: line
965-
966964
"status": r"Domain Status:\s*(.*)\r?\n",
967965
# "emails": r"(\S+@\S+)",
968966
"emails": r"[\w\.-]+@[\w\.-]+\.[\w]{2,4}",
@@ -975,7 +973,7 @@
975973
"creation_date": r"Created:\s?(.+)",
976974
"expiration_date": r"Valid Until:\s?(.+)",
977975
"updated_date": r"Updated:\s?(.+)",
978-
"name_servers": r"Nameserver:\s*(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
976+
"name_servers": r"Nameserver:\s*(\S+)", # fix needed after strip(\r) in _2_parse.py in version 0.19
979977
"registrant": r"Contact:\s?(.+)",
980978
"registrant_country": r"Country Code:\s?(.+)\nRegistrar:",
981979
}
@@ -1082,6 +1080,12 @@
10821080
"extend": "ua",
10831081
"creation_date": r"\ncreated:\s+0-UANIC\s+(.+)",
10841082
}
1083+
com_ua = {
1084+
"extend": "ua",
1085+
}
1086+
net_ua = {
1087+
"extend": "ua",
1088+
}
10851089

10861090
lviv_ua = {
10871091
"extend": "com",
@@ -1149,6 +1153,11 @@
11491153
"extend": "com",
11501154
}
11511155

1156+
web_za = { "extend": "za", "_server": "web-whois.registry.net.za" }
1157+
org_za = { "extend": "za", "_server": "org-whois.registry.net.za" }
1158+
net_za = { "extend": "za", "_server": "net-whois.registry.net.za" }
1159+
co_za = { "extend": "za" , "_server": "coza-whois.registry.net.za"}
1160+
11521161
gy = {
11531162
"extend": "com",
11541163
}
@@ -2010,6 +2019,7 @@
20102019
"registrant_country": r"registrant-country:\s+(\S+)",
20112020
"registrant": r"registrant-organi(?:s|z)ation:\s*(.+)\r?\n",
20122021
}
2022+
20132023
so = {"extend": "com"}
20142024
nrw = {"extend": "com"}
20152025
lat = {"extend": "com"}
@@ -2025,5 +2035,99 @@
20252035
blue = {"extend": "com"}
20262036
garden = {"extend": "com", "_server": "whois.nic.garden"}
20272037
promo = {"extend": "com", "_server": "whois.nic.promo"}
2028-
one = {"extend": "com"}
2038+
20292039
pyc_ = {"extend": "com"}
2040+
2041+
mn = {"extend": "com", "_server": "whois.nic.mn"}
2042+
2043+
africa = {"extend": "com", "_server": "whois.nic.africa"}
2044+
2045+
green = {"extend": "com"}
2046+
2047+
mk = {
2048+
"extend": None,
2049+
"_server": "whois.marnet.mk",
2050+
"domain_name": r"domain:\s?(.+)",
2051+
"registrar": r"registrar:\s?(.+)",
2052+
"registrant": r"registrant:\s?(.+)",
2053+
"registrant_country": r"Registrant Country:\s?(.+)",
2054+
"creation_date": r"registered:\s?(.+)",
2055+
"expiration_date": r"expire:\s?(.+)",
2056+
"updated_date": r"changed:\s?(.+)",
2057+
"name_servers": r"nserver:\s*(.+)\s*",
2058+
"status": r"Status:\s?(.+)",
2059+
# the trailing domain must have minimal 2 parts [email protected]
2060+
# it may actually have more then 4 levels
2061+
# to match the dot in firstname.lastname we must use \.
2062+
"emails": r"[\w\.-]+@[\w\.-]+\.[\w]{2,4}",
2063+
}
2064+
2065+
observer = {"extend": "com", "_server": "whois.nic.observer"}
2066+
one = {"extend": "com", "_server": "whois.nic.one"}
2067+
page = {"extend": "com", "_server": "whois.nic.google"}
2068+
2069+
bf = {
2070+
"extend": "com",
2071+
"_server": "whois.nic.bf",
2072+
"registrant": r"Registrant Name:\s?(.+)",
2073+
}
2074+
bz = {"extend": "_privateReg"}
2075+
2076+
si = {
2077+
"extend": None,
2078+
"_server": "whois.register.si",
2079+
"domain_name": r"domain:\s?(.+)",
2080+
"registrar": r"registrar:\s?(.+)",
2081+
"registrant": r"registrant:\s?(.+)",
2082+
"registrant_country": r"Registrant Country:\s?(.+)",
2083+
"creation_date": r"created:\s?(.+)",
2084+
"expiration_date": r"expire:\s?(.+)",
2085+
"updated_date": r"changed:\s?(.+)",
2086+
"name_servers": r"nameserver:\s*(.+)\s*",
2087+
"status": r"Status:\s?(.+)",
2088+
# the trailing domain must have minimal 2 parts [email protected]
2089+
# it may actually have more then 4 levels
2090+
# to match the dot in firstname.lastname we must use \.
2091+
"emails": r"[\w\.-]+@[\w\.-]+\.[\w]{2,4}",
2092+
}
2093+
2094+
sx = {"extend": "com", "_server": "whois.sx"}
2095+
2096+
tc = {
2097+
"extend": "com",
2098+
"_server": "whois.nic.tc",
2099+
"domain_name": r"Domain Name:\s?(.+)",
2100+
"registrar": r"Sponsoring Registrar:\s?(.+)",
2101+
"creation_date": r"Creation Date:\s?(.+)",
2102+
"expiration_date": r"Registry Expiry Date:\s?(.+)",
2103+
"name_servers": r"Name Server:\s*(.+)\s*",
2104+
"status": r"Domain Status:\s?(.+)",
2105+
}
2106+
2107+
wf = {
2108+
"extend": "com",
2109+
"_server": "whois.nic.wf",
2110+
"domain_name": r"domain:\s?(.+)",
2111+
"registrar": r"registrar:\s?(.+)",
2112+
"registrant": r"registrant:\s?(.+)",
2113+
"registrant_country": r"Registrant Country:\s?(.+)",
2114+
"creation_date": r"created:\s?(.+)",
2115+
"expiration_date": r"Expiry Date:\s?(.+)",
2116+
"updated_date": r"last-update:\s?(.+)",
2117+
"name_servers": r"nserver:\s*(.+)\s*",
2118+
"status": r"\nstatus:\s?(.+)",
2119+
}
2120+
2121+
lk = {"extend": "_privateReg"} # Sri Lanka, whois.nic.lk exists but does not answer
2122+
eg = {"extend": "_privateReg"} # Egipt
2123+
com_eg = {"extend": "_privateReg"} # Egipt
2124+
2125+
mo = {
2126+
"extend": "com",
2127+
"_server": "whois.monic.mo",
2128+
"name_servers": r"Domain name servers:\s+-+\s+(\S+)\n(?:(\S+)\n)?(?:(\S+)\n)?(?:(\S+)\n)?",
2129+
"creation_date": r"Record created on (.+)",
2130+
"expiration_date": r"Record expires on (.+)",
2131+
}
2132+
2133+
ph = {"extend": "_privateReg"}

0 commit comments

Comments
 (0)