Skip to content

Commit 9b8a68d

Browse files
committed
Release 2.4.2
2 parents dfc8fa0 + 3ce6378 commit 9b8a68d

22 files changed

+422
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
dist
44
*.egg-info
55
.tox
6+
.DS_Store

pythonwhois/net.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from codecs import encode, decode
33
from . import shared
44

5-
def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False, with_server_list=False, server_list=[]):
5+
def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=False, with_server_list=False, server_list=None):
6+
previous = previous or []
7+
server_list = server_list or []
68
# Sometimes IANA simply won't give us the right root WHOIS server
79
exceptions = {
810
".ac.uk": "whois.ja.net",
@@ -20,7 +22,6 @@ def get_whois_raw(domain, server="", previous=[], rfc3490=True, never_cut=False,
2022

2123
if len(previous) == 0 and server == "":
2224
# Root query
23-
server_list = [] # Otherwise it retains the list on subsequent queries, for some reason.
2425
is_exception = False
2526
for exception, exc_serv in exceptions.items():
2627
if domain.endswith(exception):

pythonwhois/parse.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ def preprocess_regex(regex):
247247
" Registrant:\n (?P<organization>.+)\n (?P<name>.+) (?P<email>.+)\n (?P<phone>.*)\n (?P<fax>.*)\n (?P<street>.*)\n (?P<city>.+), (?P<state>[^,\n]*)\n (?P<country>.+)\n", # .com.tw (Western registrars)
248248
"Registrant:\n(?P<organization1>.+)\n(?P<organization2>.+)\n(?P<street1>.+?)(?:,+(?P<street2>.+?)(?:,+(?P<street3>.+?)(?:,+(?P<street4>.+?)(?:,+(?P<street5>.+?)(?:,+(?P<street6>.+?)(?:,+(?P<street7>.+?))?)?)?)?)?)?,(?P<city>.+),(?P<country>.+)\n\n Contact:\n (?P<name>.+) (?P<email>.+)\n TEL: (?P<phone>.+?)(?:(?:#|ext.?)(?P<phone_ext>.+))?\n FAX: (?P<fax>.+)(?:(?:#|ext.?)(?P<fax_ext>.+))?\n", # .com.tw (TWNIC/SEEDNET, Taiwanese companies only?)
249249
"Registrant Contact Information:\n\nCompany English Name \(It should be the same as the registered/corporation name on your Business Register Certificate or relevant documents\):(?P<organization1>.+)\nCompany Chinese name:(?P<organization2>.+)\nAddress: (?P<street>.+)\nCountry: (?P<country>.+)\nEmail: (?P<email>.+)\n", # HKDNR (.hk)
250+
"Registrant ID:(?P<handle>.+)\nRegistrant Name:(?P<name>.*)\n(?:Registrant Organization:(?P<organization>.*)\n)?Registrant Street1:(?P<street1>.+?)\n(?:Registrant Street2:(?P<street2>.+?)\n(?:Registrant Street2:(?P<street3>.+?)\n)?)?Registrant City:(?P<city>.+)\nRegistrant State:(?P<state>.*)\nRegistrant Postal Code:(?P<postalcode>.+)\nRegistrant Country:(?P<country>[A-Z]+)\nRegistrant Phone:(?P<phone>.*?)\nRegistrant Fax:(?P<fax>.*)\nRegistrant Email:(?P<email>.+)\n", # Realtime Register
250251
"owner:\s+(?P<name>.+)", # .br
251252
"person:\s+(?P<name>.+)", # nic.ru (person)
252253
"org:\s+(?P<organization>.+)", # nic.ru (organization)
@@ -284,6 +285,7 @@ def preprocess_regex(regex):
284285
"Tech Contact: (?P<handle>.+)\n(?P<organization>.+)\n(?P<street1>.+)\n(?P<street2>.+)\n(?:(?P<street3>.+)\n)?(?P<city>.+)\n(?P<postalcode>.+)\n(?P<country>[A-Z]+)\n", # .co.th, format 6
285286
" Technical Contact:\n (?P<name>.+) (?P<email>.+)\n (?P<phone>.*)\n (?P<fax>.*)\n", # .com.tw (Western registrars)
286287
"Technical Contact Information:\n\n(?:Given name: (?P<firstname>.+)\n)?(?:Family name: (?P<lastname>.+)\n)?(?:Company name: (?P<organization>.+)\n)?Address: (?P<street>.+)\nCountry: (?P<country>.+)\nPhone: (?P<phone>.*)\nFax: (?P<fax>.*)\nEmail: (?P<email>.+)\n(?:Account Name: (?P<handle>.+)\n)?", # HKDNR (.hk)
288+
"TECH ID:(?P<handle>.+)\nTECH Name:(?P<name>.*)\n(?:TECH Organization:(?P<organization>.*)\n)?TECH Street1:(?P<street1>.+?)\n(?:TECH Street2:(?P<street2>.+?)\n(?:TECH Street2:(?P<street3>.+?)\n)?)?TECH City:(?P<city>.+)\nTECH State:(?P<state>.*)\nTECH Postal Code:(?P<postalcode>.+)\nTECH Country:(?P<country>[A-Z]+)\nTECH Phone:(?P<phone>.*?)\nTECH Fax:(?P<fax>.*)\nTECH Email:(?P<email>.+)\n", # Realtime Register
287289
]
288290

289291
admin_contact_regexes = [
@@ -309,6 +311,7 @@ def preprocess_regex(regex):
309311
"\[Tech-C\]\nType: (?P<type>.+)\nName: (?P<name>.+)\n(Organisation: (?P<organization>.+)\n){0,1}(Address: (?P<street1>.+)\n){1}(Address: (?P<street2>.+)\n){0,1}(Address: (?P<street3>.+)\n){0,1}(Address: (?P<street4>.+)\n){0,1}PostalCode: (?P<postalcode>.+)\nCity: (?P<city>.+)\nCountryCode: (?P<country>[A-Za-z]{2})\nPhone: (?P<phone>.+)\nFax: (?P<fax>.+)\nEmail: (?P<email>.+)\n(Remarks: (?P<remark>.+)\n){0,1}Changed: (?P<changed>.+)", # DeNIC
310312
" Administrative Contact:\n (?P<name>.+) (?P<email>.+)\n (?P<phone>.*)\n (?P<fax>.*)\n", # .com.tw (Western registrars)
311313
"Administrative Contact Information:\n\n(?:Given name: (?P<firstname>.+)\n)?(?:Family name: (?P<lastname>.+)\n)?(?:Company name: (?P<organization>.+)\n)?Address: (?P<street>.+)\nCountry: (?P<country>.+)\nPhone: (?P<phone>.*)\nFax: (?P<fax>.*)\nEmail: (?P<email>.+)\n(?:Account Name: (?P<handle>.+)\n)?", # HKDNR (.hk)
314+
"ADMIN ID:(?P<handle>.+)\nADMIN Name:(?P<name>.*)\n(?:ADMIN Organization:(?P<organization>.*)\n)?ADMIN Street1:(?P<street1>.+?)\n(?:ADMIN Street2:(?P<street2>.+?)\n(?:ADMIN Street2:(?P<street3>.+?)\n)?)?ADMIN City:(?P<city>.+)\nADMIN State:(?P<state>.*)\nADMIN Postal Code:(?P<postalcode>.+)\nADMIN Country:(?P<country>[A-Z]+)\nADMIN Phone:(?P<phone>.*?)\nADMIN Fax:(?P<fax>.*)\nADMIN Email:(?P<email>.+)\n", # Realtime Register
312315
]
313316

314317
billing_contact_regexes = [
@@ -325,6 +328,7 @@ def preprocess_regex(regex):
325328
"Billing contact:\n(?: (?P<organization>.+)\n)? (?P<name>.+)\n (?P<email>.+)\n (?P<street>.+)\n (?P<city>.+), (?P<state>.+) (?P<postalcode>.+) (?P<country>.+)\n Phone: (?P<phone>.*)\n Fax: (?P<fax>.*)\n", # Fabulous.com
326329
"Billing Contact Information :[ ]*\n[ ]+(?P<firstname>.*)\n[ ]+(?P<lastname>.*)\n[ ]+(?P<organization>.*)\n[ ]+(?P<email>.*)\n[ ]+(?P<street>.*)\n[ ]+(?P<city>.*)\n[ ]+(?P<postalcode>.*)\n[ ]+(?P<phone>.*)\n[ ]+(?P<fax>.*)\n\n", # GAL Communication
327330
"Billing Contact:\n Name: (?P<name>.+)\n City: (?P<city>.+)\n State: (?P<state>.+)\n Country: (?P<country>.+)\n", # Akky (.com.mx)
331+
"BILLING ID:(?P<handle>.+)\nBILLING Name:(?P<name>.*)\n(?:BILLING Organization:(?P<organization>.*)\n)?BILLING Street1:(?P<street1>.+?)\n(?:BILLING Street2:(?P<street2>.+?)\n(?:BILLING Street2:(?P<street3>.+?)\n)?)?BILLING City:(?P<city>.+)\nBILLING State:(?P<state>.*)\nBILLING Postal Code:(?P<postalcode>.+)\nBILLING Country:(?P<country>[A-Z]+)\nBILLING Phone:(?P<phone>.*?)\nBILLING Fax:(?P<fax>.*)\nBILLING Email:(?P<email>.+)\n", # Realtime Register
328332
]
329333

330334
# Some registries use NIC handle references instead of directly listing contacts...
@@ -426,7 +430,8 @@ def is_string(data):
426430
return isinstance(data, str)
427431

428432

429-
def parse_raw_whois(raw_data, normalized=[], never_query_handles=True, handle_server=""):
433+
def parse_raw_whois(raw_data, normalized=None, never_query_handles=True, handle_server=""):
434+
normalized = normalized or []
430435
data = {}
431436

432437
raw_data = [segment.replace("\r", "") for segment in raw_data] # Carriage returns are the devil
@@ -995,4 +1000,4 @@ def parse_nic_contact(data):
9951000
for match in matches:
9961001
handle_contacts.append(match.groupdict())
9971002

998-
return handle_contacts
1003+
return handle_contacts

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup
22

33
setup(name='pythonwhois',
4-
version='2.4.1',
4+
version='2.4.2',
55
description='Module for retrieving and parsing the WHOIS data for a domain. Supports most domains. No dependencies.',
66
author='Sven Slootweg',
77
author_email='[email protected]',

test/data/0007games.com

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Domain Name:0007games.com
2+
Name Server:ns159.mihanwebhost.com
3+
Name Server:ns160.mihanwebhost.com
4+
Created On:2013-10-14 08:59:57.0
5+
Last Updated On:2013-11-13 02:09:37.0
6+
Expiration Date:2014-10-14 08:59:57.0
7+
Sponsoring Registrar:REALTIME REGISTER B.V.
8+
Reseller:Hostcontrol
9+
Status:CLIENT_TRANSFER_PROHIBITED
10+
Status:OK
11+
Registrant ID:RC_30314652
12+
Registrant Name:yashar ayubi
13+
Registrant Organization:N/A
14+
Registrant Street1:karaj
15+
Registrant City:karaj
16+
Registrant State:alborz
17+
Registrant Postal Code:1234
18+
Registrant Country:IR
19+
Registrant Phone:+98.09128601236
20+
Registrant Fax:
21+
Registrant Email:[email protected]
22+
TECH ID:RC_30314652
23+
TECH Name:yashar ayubi
24+
TECH Organization:N/A
25+
TECH Street1:karaj
26+
TECH City:karaj
27+
TECH State:alborz
28+
TECH Postal Code:1234
29+
TECH Country:IR
30+
TECH Phone:+98.09128601236
31+
TECH Fax:
32+
33+
ADMIN ID:RC_30314652
34+
ADMIN Name:yashar ayubi
35+
ADMIN Organization:N/A
36+
ADMIN Street1:karaj
37+
ADMIN City:karaj
38+
ADMIN State:alborz
39+
ADMIN Postal Code:1234
40+
ADMIN Country:IR
41+
ADMIN Phone:+98.09128601236
42+
ADMIN Fax:
43+
ADMIN Email:[email protected]
44+
BILLING ID:RC_30314652
45+
BILLING Name:yashar ayubi
46+
BILLING Organization:N/A
47+
BILLING Street1:karaj
48+
BILLING City:karaj
49+
BILLING State:alborz
50+
BILLING Postal Code:1234
51+
BILLING Country:IR
52+
BILLING Phone:+98.09128601236
53+
BILLING Fax:
54+
BILLING Email:[email protected]
55+
56+
--
57+
Domain Name: 0007GAMES.COM
58+
Registrar: REALTIME REGISTER BV
59+
Whois Server: whois.yoursrs.com
60+
Referral URL: http://www.realtimeregister.com
61+
Name Server: NS159.MIHANWEBHOST.COM
62+
Name Server: NS160.MIHANWEBHOST.COM
63+
Status: clientTransferProhibited
64+
Updated Date: 12-nov-2013
65+
Creation Date: 14-oct-2013
66+
Expiration Date: 14-oct-2014

test/data/0031fashion.com

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Domain Name:0031fashion.com
2+
Name Server:ns3.firstfind.nl
3+
Name Server:ns4.firstfind.nl
4+
Name Server:ns5.firstfind.net
5+
Created On:2013-03-25 11:48:37.0
6+
Last Updated On:2014-03-27 00:00:25.0
7+
Expiration Date:2015-03-25 10:48:37.0
8+
Sponsoring Registrar:REALTIME REGISTER B.V.
9+
Reseller:Your Hosting B.V.
10+
Status:OK
11+
Registrant ID:ULYdHkU6vYELLiJqKUmu
12+
Registrant Name:A. Blom
13+
Registrant Organization:Hotshopper
14+
Registrant Street1:Blankenheymstraat 13
15+
Registrant City:NUMANSDORP
16+
Registrant State:
17+
Registrant Postal Code:3281 SB
18+
Registrant Country:NL
19+
Registrant Phone:+31.648265085
20+
Registrant Fax:
21+
Registrant Email:[email protected]
22+
23+
BILLING Name:Valentijn Borstlap
24+
BILLING Organization:YourHosting BV
25+
BILLING Street1:Schrevenweg 5
26+
BILLING City:Zwolle
27+
BILLING State:Overijssel
28+
BILLING Postal Code:8024 HB
29+
BILLING Country:NL
30+
BILLING Phone:+31.384530752
31+
BILLING Fax:+31.384524734
32+
BILLING Email:[email protected]
33+
34+
TECH Name:Valentijn Borstlap
35+
TECH Organization:YourHosting BV
36+
TECH Street1:Schrevenweg 5
37+
TECH City:Zwolle
38+
TECH State:Overijssel
39+
TECH Postal Code:8024 HB
40+
TECH Country:NL
41+
TECH Phone:+31.384530752
42+
TECH Fax:+31.384524734
43+
44+
45+
ADMIN Name:Valentijn Borstlap
46+
ADMIN Organization:YourHosting BV
47+
ADMIN Street1:Schrevenweg 5
48+
ADMIN City:Zwolle
49+
ADMIN State:Overijssel
50+
ADMIN Postal Code:8024 HB
51+
ADMIN Country:NL
52+
ADMIN Phone:+31.384530752
53+
ADMIN Fax:+31.384524734
54+
ADMIN Email:[email protected]
55+
56+
--
57+
Domain Name: 0031FASHION.COM
58+
Registrar: REALTIME REGISTER BV
59+
Whois Server: whois.yoursrs.com
60+
Referral URL: http://www.realtimeregister.com
61+
Name Server: NS3.FIRSTFIND.NL
62+
Name Server: NS4.FIRSTFIND.NL
63+
Name Server: NS5.FIRSTFIND.NET
64+
Status: ok
65+
Updated Date: 26-mar-2014
66+
Creation Date: 25-mar-2013
67+
Expiration Date: 25-mar-2015

test/data/arkeysolutions.com

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Domain Name:arkeysolutions.com
2+
Name Server:ns.axfone.sk
3+
Name Server:ns.axfone.eu
4+
Name Server:ns.axfone.cz
5+
Created On:2013-01-21 16:11:03.0
6+
Last Updated On:2014-04-09 14:53:04.0
7+
Expiration Date:2015-01-21 16:11:03.0
8+
Sponsoring Registrar:REALTIME REGISTER B.V.
9+
Reseller:Axfone s.r.o.
10+
Status:OK
11+
Registrant ID:AXC432303721
12+
Registrant Name:Róbert Kriško
13+
Registrant Organization:Arkey, s.r.o.
14+
Registrant Street1:Tr. SNP 74
15+
Registrant City:Košice
16+
Registrant State:
17+
Registrant Postal Code:04011
18+
Registrant Country:SK
19+
Registrant Phone:+421.902110378
20+
Registrant Fax:
21+
Registrant Email:[email protected]
22+
ADMIN ID:REG_AXFONE
23+
ADMIN Name:Jakub Vlach
24+
ADMIN Organization:Axfone s.r.o.
25+
ADMIN Street1:Pripotocni 1519/10c
26+
ADMIN City:Praha 10
27+
ADMIN State:Praha
28+
ADMIN Postal Code:10100
29+
ADMIN Country:CZ
30+
ADMIN Phone:+420.277277272
31+
ADMIN Fax:+420.241410071
32+
ADMIN Email:[email protected]
33+
TECH ID:REG_AXFONE
34+
TECH Name:Jakub Vlach
35+
TECH Organization:Axfone s.r.o.
36+
TECH Street1:Pripotocni 1519/10c
37+
TECH City:Praha 10
38+
TECH State:Praha
39+
TECH Postal Code:10100
40+
TECH Country:CZ
41+
TECH Phone:+420.277277272
42+
TECH Fax:+420.241410071
43+
44+
BILLING ID:REG_AXFONE
45+
BILLING Name:Jakub Vlach
46+
BILLING Organization:Axfone s.r.o.
47+
BILLING Street1:Pripotocni 1519/10c
48+
BILLING City:Praha 10
49+
BILLING State:Praha
50+
BILLING Postal Code:10100
51+
BILLING Country:CZ
52+
BILLING Phone:+420.277277272
53+
BILLING Fax:+420.241410071
54+
BILLING Email:[email protected]
55+
56+
--
57+
Domain Name: ARKEYSOLUTIONS.COM
58+
Registrar: REALTIME REGISTER BV
59+
Whois Server: whois.yoursrs.com
60+
Referral URL: http://www.realtimeregister.com
61+
Name Server: NS.AXFONE.CZ
62+
Name Server: NS.AXFONE.EU
63+
Name Server: NS.AXFONE.SK
64+
Status: ok
65+
Updated Date: 09-apr-2014
66+
Creation Date: 21-jan-2013
67+
Expiration Date: 21-jan-2015

test/data/simpardaz.com

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
Domain Name:simpardaz.com
2+
Name Server:ns1.winent.aryanic.org
3+
Name Server:ns2.winent.aryanic.org
4+
Created On:2013-04-30 10:44:30.0
5+
Last Updated On:2014-06-14 10:44:30.0
6+
Expiration Date:2015-04-30 10:44:30.0
7+
Sponsoring Registrar:REALTIME REGISTER B.V.
8+
Reseller:Hostcontrol
9+
Status:CLIENT_TRANSFER_PROHIBITED
10+
Status:OK
11+
Registrant ID:RC_27661353
12+
Registrant Name:ahmad lotfi
13+
Registrant Organization:ahmad lotfi
14+
Registrant Street1:No. 238
15+
Registrant City:Tehran
16+
Registrant State:Tehran
17+
Registrant Postal Code:98970
18+
Registrant Country:IN
19+
Registrant Phone:+98.2166424812
20+
Registrant Fax:
21+
Registrant Email:[email protected]
22+
BILLING ID:RC_27661353
23+
BILLING Name:ahmad lotfi
24+
BILLING Organization:ahmad lotfi
25+
BILLING Street1:No. 238
26+
BILLING City:Tehran
27+
BILLING State:Tehran
28+
BILLING Postal Code:98970
29+
BILLING Country:IN
30+
BILLING Phone:+98.2166424812
31+
BILLING Fax:
32+
BILLING Email:[email protected]
33+
TECH ID:RC_27661353
34+
TECH Name:ahmad lotfi
35+
TECH Organization:ahmad lotfi
36+
TECH Street1:No. 238
37+
TECH City:Tehran
38+
TECH State:Tehran
39+
TECH Postal Code:98970
40+
TECH Country:IN
41+
TECH Phone:+98.2166424812
42+
TECH Fax:
43+
44+
ADMIN ID:RC_27661353
45+
ADMIN Name:ahmad lotfi
46+
ADMIN Organization:ahmad lotfi
47+
ADMIN Street1:No. 238
48+
ADMIN City:Tehran
49+
ADMIN State:Tehran
50+
ADMIN Postal Code:98970
51+
ADMIN Country:IN
52+
ADMIN Phone:+98.2166424812
53+
ADMIN Fax:
54+
ADMIN Email:[email protected]
55+
56+
--
57+
Domain Name: SIMPARDAZ.COM
58+
Registrar: REALTIME REGISTER BV
59+
Whois Server: whois.yoursrs.com
60+
Referral URL: http://www.realtimeregister.com
61+
Name Server: NS1.WINENT.ARYANIC.ORG
62+
Name Server: NS2.WINENT.ARYANIC.ORG
63+
Status: clientTransferProhibited
64+
Updated Date: 06-may-2014
65+
Creation Date: 30-apr-2013
66+
Expiration Date: 30-apr-2015

0 commit comments

Comments
 (0)