From 80fb22aa4f6e7e931f827ba29f529530a2da5f42 Mon Sep 17 00:00:00 2001 From: joe doe Date: Tue, 18 Feb 2014 14:56:19 +0100 Subject: [PATCH 01/12] added .de region specific support --- pythonwhois/net.py | 2 + test/data/test.de | 69 ++++++++++++++++++++++++++++++++++ test/domains.txt | 1 + test/target_default/test.de | 1 + test/target_normalized/test.de | 1 + 5 files changed, 74 insertions(+) create mode 100644 test/data/test.de create mode 100644 test/target_default/test.de create mode 100644 test/target_normalized/test.de diff --git a/pythonwhois/net.py b/pythonwhois/net.py index 3021beb..1b2103d 100644 --- a/pythonwhois/net.py +++ b/pythonwhois/net.py @@ -9,6 +9,8 @@ def get_whois_raw(domain, server="", previous=[]): target_server = server if domain.endswith(".jp") and target_server == "whois.jprs.jp": request_domain = "%s/e" % domain # Suppress Japanese output + elif domain.endswith(".de"): + request_domain = "-T dn,ace -C US-ASCII %s" % domain # regional specific stuff elif target_server == "whois.verisign-grs.com": request_domain = "=%s" % domain # Avoid partial matches else: diff --git a/test/data/test.de b/test/data/test.de new file mode 100644 index 0000000..24ba15d --- /dev/null +++ b/test/data/test.de @@ -0,0 +1,69 @@ +% Copyright (c) 2010 by DENIC +% Version: 2.0 +% +% Restricted rights. +% +% Terms and Conditions of Use +% +% The data in this record is provided by DENIC for informational purposes only. +% DENIC does not guarantee its accuracy and cannot, under any circumstances, +% be held liable in case the stored information would prove to be wrong, +% incomplete or not accurate in any sense. +% +% All the domain data that is visible in the whois service is protected by law. +% It is not permitted to use it for any purpose other than technical or +% administrative requirements associated with the operation of the Internet. +% It is explicitly forbidden to extract, copy and/or use or re-utilise in any +% form and by any means (electronically or not) the whole or a quantitatively +% or qualitatively substantial part of the contents of the whois database +% without prior and explicit written permission by DENIC. +% It is prohibited, in particular, to use it for transmission of unsolicited +% and/or commercial and/or advertising by phone, fax, e-mail or for any similar +% purposes. +% +% By maintaining the connection you assure that you have a legitimate interest +% in the data and that you will only use it for the stated purposes. You are +% aware that DENIC maintains the right to initiate legal proceedings against +% you in the event of any breach of this assurance and to bar you from using +% its whois service. +% +% The DENIC whois service on port 43 never discloses any information concerning +% the domain holder/administrative contact. Information concerning the domain +% holder/administrative contact can be obtained through use of our web-based +% whois service available at the DENIC website: +% http://www.denic.de/en/domains/whois-service/web-whois.html +% + +Domain: test.de +Nserver: dns.iwelt-ag.net +Nserver: dns2.iwelt-ag.net +Nserver: dns3.iwelt-ag.de +Status: connect +Changed: 2013-04-10T11:11:41+02:00 + +[Tech-C] +Type: PERSON +Name: Christian Zantop +Organisation: Stiftung Warentest +Address: Luetzowplatz 11-13 +PostalCode: 10785 +City: Berlin +CountryCode: DE +Phone: +49.3026312604 +Fax: +49.3026312342 +Email: webmaster@stiftung-warentest.de +Changed: 2013-03-19T14:16:18+01:00 + +[Zone-C] +Type: ROLE +Name: Domainservice +Organisation: iWelt AG +Address: Mainparkring 4 +PostalCode: 97246 +City: Eibelstadt +CountryCode: DE +Phone: +49.9303982860 +Fax: +49.9303982879 +Email: support@iwelt.de +Changed: 2013-08-05T11:43:45+02:00 + diff --git a/test/domains.txt b/test/domains.txt index 8263889..8db0525 100644 --- a/test/domains.txt +++ b/test/domains.txt @@ -43,3 +43,4 @@ tpc.int keybase.io whois.us freebnc.net +test.de diff --git a/test/target_default/test.de b/test/target_default/test.de new file mode 100644 index 0000000..8623077 --- /dev/null +++ b/test/target_default/test.de @@ -0,0 +1 @@ +{"status": ["connect"], "updated_date": ["2013-04-10T11:11:41", "2013-03-19T14:16:18", "2013-08-05T11:43:45"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["dns.iwelt-ag.net", "dns2.iwelt-ag.net", "dns3.iwelt-ag.de"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: test.de\nNserver: dns.iwelt-ag.net\nNserver: dns2.iwelt-ag.net\nNserver: dns3.iwelt-ag.de\nStatus: connect\nChanged: 2013-04-10T11:11:41+02:00\n\n[Tech-C]\nType: PERSON\nName: Christian Zantop\nOrganisation: Stiftung Warentest\nAddress: Luetzowplatz 11-13\nPostalCode: 10785\nCity: Berlin\nCountryCode: DE\nPhone: +49.3026312604\nFax: +49.3026312342\nEmail: webmaster@stiftung-warentest.de\nChanged: 2013-03-19T14:16:18+01:00\n\n[Zone-C]\nType: ROLE\nName: Domainservice\nOrganisation: iWelt AG\nAddress: Mainparkring 4\nPostalCode: 97246\nCity: Eibelstadt\nCountryCode: DE\nPhone: +49.9303982860\nFax: +49.9303982879\nEmail: support@iwelt.de\nChanged: 2013-08-05T11:43:45+02:00\n\n"], "emails": ["webmaster@stiftung-warentest.de", "support@iwelt.de"]} \ No newline at end of file diff --git a/test/target_normalized/test.de b/test/target_normalized/test.de new file mode 100644 index 0000000..c403680 --- /dev/null +++ b/test/target_normalized/test.de @@ -0,0 +1 @@ +{"status": ["Connect"], "updated_date": ["2013-04-10T11:11:41", "2013-03-19T14:16:18", "2013-08-05T11:43:45"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["dns.iwelt-ag.net", "dns2.iwelt-ag.net", "dns3.iwelt-ag.de"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: test.de\nNserver: dns.iwelt-ag.net\nNserver: dns2.iwelt-ag.net\nNserver: dns3.iwelt-ag.de\nStatus: connect\nChanged: 2013-04-10T11:11:41+02:00\n\n[Tech-C]\nType: PERSON\nName: Christian Zantop\nOrganisation: Stiftung Warentest\nAddress: Luetzowplatz 11-13\nPostalCode: 10785\nCity: Berlin\nCountryCode: DE\nPhone: +49.3026312604\nFax: +49.3026312342\nEmail: webmaster@stiftung-warentest.de\nChanged: 2013-03-19T14:16:18+01:00\n\n[Zone-C]\nType: ROLE\nName: Domainservice\nOrganisation: iWelt AG\nAddress: Mainparkring 4\nPostalCode: 97246\nCity: Eibelstadt\nCountryCode: DE\nPhone: +49.9303982860\nFax: +49.9303982879\nEmail: support@iwelt.de\nChanged: 2013-08-05T11:43:45+02:00\n\n"], "emails": ["webmaster@stiftung-warentest.de", "support@iwelt.de"]} \ No newline at end of file From cc2f209d5235ac991cba47e8d60e10f51f8221ac Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Tue, 18 Feb 2014 15:54:59 +0100 Subject: [PATCH 02/12] Update net.py --- pythonwhois/net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonwhois/net.py b/pythonwhois/net.py index 1b2103d..d33945e 100644 --- a/pythonwhois/net.py +++ b/pythonwhois/net.py @@ -9,7 +9,7 @@ def get_whois_raw(domain, server="", previous=[]): target_server = server if domain.endswith(".jp") and target_server == "whois.jprs.jp": request_domain = "%s/e" % domain # Suppress Japanese output - elif domain.endswith(".de"): + elif domain.endswith(".de") and ( target_server == "whois.denic.de" or target_server == "de.whois-servers.net" ): request_domain = "-T dn,ace -C US-ASCII %s" % domain # regional specific stuff elif target_server == "whois.verisign-grs.com": request_domain = "=%s" % domain # Avoid partial matches From a86d44dfdc8a179f53aa8494f885eb694302d882 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Tue, 18 Feb 2014 17:10:32 +0100 Subject: [PATCH 03/12] added RFC3490 feature (decoded unicode domains) --- pythonwhois/net.py | 9 ++- test/data/alliancefrançaise.nu | 33 ++++++++++ test/data/bäckerei.de | 67 +++++++++++++++++++++ test/target_default/alliancefrançaise.nu | 1 + test/target_default/bäckerei.de | 1 + test/target_normalized/alliancefrançaise.nu | 1 + test/target_normalized/bäckerei.de | 1 + 7 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 test/data/alliancefrançaise.nu create mode 100644 test/data/bäckerei.de create mode 100644 test/target_default/alliancefrançaise.nu create mode 100644 test/target_default/bäckerei.de create mode 100644 test/target_normalized/alliancefrançaise.nu create mode 100644 test/target_normalized/bäckerei.de diff --git a/pythonwhois/net.py b/pythonwhois/net.py index d33945e..ed7251e 100644 --- a/pythonwhois/net.py +++ b/pythonwhois/net.py @@ -1,7 +1,12 @@ import socket, re +from codecs import encode, decode from . import shared -def get_whois_raw(domain, server="", previous=[]): +def get_whois_raw(domain, server="", previous=[], rfc3490=True): + + if rfc3490: + domain = encode( domain if type(domain) is unicode else decode(domain, "utf8"), "idna" ) + if len(previous) == 0: # Root query target_server = get_root_server(domain) @@ -10,7 +15,7 @@ def get_whois_raw(domain, server="", previous=[]): if domain.endswith(".jp") and target_server == "whois.jprs.jp": request_domain = "%s/e" % domain # Suppress Japanese output elif domain.endswith(".de") and ( target_server == "whois.denic.de" or target_server == "de.whois-servers.net" ): - request_domain = "-T dn,ace -C US-ASCII %s" % domain # regional specific stuff + request_domain = "-T dn,ace %s" % domain # regional specific stuff elif target_server == "whois.verisign-grs.com": request_domain = "=%s" % domain # Avoid partial matches else: diff --git a/test/data/alliancefrançaise.nu b/test/data/alliancefrançaise.nu new file mode 100644 index 0000000..b88f365 --- /dev/null +++ b/test/data/alliancefrançaise.nu @@ -0,0 +1,33 @@ +# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation). +# All rights reserved. + +# The information obtained through searches, or otherwise, is protected +# by the Swedish Copyright Act (1960:729) and international conventions. +# It is also subject to database protection according to the Swedish +# Copyright Act. + +# Any use of this material to target advertising or +# similar activities is forbidden and will be prosecuted. +# If any of the information below is transferred to a third +# party, it must be done in its entirety. This server must +# not be used as a backend for a search engine. + +# Result of search for registered domain names under +# the .nu top level domain. +# The data is in the UTF-8 character set and the result is +# printed with eight bits. +state: active +domain: xn--alliancefranaise-npb.nu (alliancefrançaise.nu) +holder: qi9c3zbvhr +admin-c: qi9c3zbvhr +tech-c: qi9c3zbvhr +billing-c: qi9c3zbvhr +created: 2010-03-02 +modified: 2014-01-24 +expires: 2021-06-02 +nserver: ns01.hostcontrol.com +nserver: ns02.hostcontrol.com +dnssec: unsigned delegation +status: ok +registrar: Worldnames, Inc. + diff --git a/test/data/bäckerei.de b/test/data/bäckerei.de new file mode 100644 index 0000000..9a81feb --- /dev/null +++ b/test/data/bäckerei.de @@ -0,0 +1,67 @@ +% Copyright (c) 2010 by DENIC +% Version: 2.0 +% +% Restricted rights. +% +% Terms and Conditions of Use +% +% The data in this record is provided by DENIC for informational purposes only. +% DENIC does not guarantee its accuracy and cannot, under any circumstances, +% be held liable in case the stored information would prove to be wrong, +% incomplete or not accurate in any sense. +% +% All the domain data that is visible in the whois service is protected by law. +% It is not permitted to use it for any purpose other than technical or +% administrative requirements associated with the operation of the Internet. +% It is explicitly forbidden to extract, copy and/or use or re-utilise in any +% form and by any means (electronically or not) the whole or a quantitatively +% or qualitatively substantial part of the contents of the whois database +% without prior and explicit written permission by DENIC. +% It is prohibited, in particular, to use it for transmission of unsolicited +% and/or commercial and/or advertising by phone, fax, e-mail or for any similar +% purposes. +% +% By maintaining the connection you assure that you have a legitimate interest +% in the data and that you will only use it for the stated purposes. You are +% aware that DENIC maintains the right to initiate legal proceedings against +% you in the event of any breach of this assurance and to bar you from using +% its whois service. +% +% The DENIC whois service on port 43 never discloses any information concerning +% the domain holder/administrative contact. Information concerning the domain +% holder/administrative contact can be obtained through use of our web-based +% whois service available at the DENIC website: +% http://www.denic.de/en/domains/whois-service/web-whois.html +% + +Domain: bäckerei.de +Domain-Ace: xn--bckerei-5wa.de +Nserver: ns1.parkingcrew.net +Nserver: ns2.parkingcrew.net +Status: connect +Changed: 2013-04-03T00:14:26+02:00 + +[Tech-C] +Type: PERSON +Name: Mechelke Jens +Address: Heidberger Strasse 1a +PostalCode: 28865 +City: Lilienthal +CountryCode: DE +Phone: +49.4298939487 +Fax: +49.4298939488 +Email: jens@mechelke.de +Changed: 2008-05-27T16:56:58+02:00 + +[Zone-C] +Type: PERSON +Name: Mechelke Jens +Address: Heidberger Strasse 1a +PostalCode: 28865 +City: Lilienthal +CountryCode: DE +Phone: +49.4298939487 +Fax: +49.4298939488 +Email: jens@mechelke.de +Changed: 2008-05-27T16:56:58+02:00 + diff --git a/test/target_default/alliancefrançaise.nu b/test/target_default/alliancefrançaise.nu new file mode 100644 index 0000000..2e7869e --- /dev/null +++ b/test/target_default/alliancefrançaise.nu @@ -0,0 +1 @@ +{"status": ["active", "ok"], "updated_date": ["2014-01-24T00:00:00"], "contacts": {"admin": {"handle": "qi9c3zbvhr"}, "tech": {"handle": "qi9c3zbvhr"}, "registrant": {"handle": "qi9c3zbvhr"}, "billing": {"handle": "qi9c3zbvhr"}}, "nameservers": ["ns01.hostcontrol.com", "ns02.hostcontrol.com"], "expiration_date": ["2021-06-02T00:00:00"], "creation_date": ["2010-03-02T00:00:00"], "raw": ["# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation). \n# All rights reserved. \n\n# The information obtained through searches, or otherwise, is protected \n# by the Swedish Copyright Act (1960:729) and international conventions. \n# It is also subject to database protection according to the Swedish \n# Copyright Act. \n\n# Any use of this material to target advertising or \n# similar activities is forbidden and will be prosecuted. \n# If any of the information below is transferred to a third \n# party, it must be done in its entirety. This server must \n# not be used as a backend for a search engine. \n\n# Result of search for registered domain names under \n# the .nu top level domain. \n# The data is in the UTF-8 character set and the result is \n# printed with eight bits.\nstate: active\ndomain: xn--alliancefranaise-npb.nu (alliancefran\u00e7aise.nu)\nholder: qi9c3zbvhr\nadmin-c: qi9c3zbvhr\ntech-c: qi9c3zbvhr\nbilling-c: qi9c3zbvhr\ncreated: 2010-03-02\nmodified: 2014-01-24\nexpires: 2021-06-02\nnserver: ns01.hostcontrol.com\nnserver: ns02.hostcontrol.com\ndnssec: unsigned delegation\nstatus: ok\nregistrar: Worldnames, Inc.\n\n"], "registrar": ["Worldnames, Inc."]} \ No newline at end of file diff --git a/test/target_default/bäckerei.de b/test/target_default/bäckerei.de new file mode 100644 index 0000000..706962a --- /dev/null +++ b/test/target_default/bäckerei.de @@ -0,0 +1 @@ +{"status": ["connect"], "updated_date": ["2013-04-03T00:14:26", "2008-05-27T16:56:58"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.parkingcrew.net", "ns2.parkingcrew.net"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: b\u00e4ckerei.de\nDomain-Ace: xn--bckerei-5wa.de\nNserver: ns1.parkingcrew.net\nNserver: ns2.parkingcrew.net\nStatus: connect\nChanged: 2013-04-03T00:14:26+02:00\n\n[Tech-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n[Zone-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n"], "emails": ["jens@mechelke.de"]} \ No newline at end of file diff --git a/test/target_normalized/alliancefrançaise.nu b/test/target_normalized/alliancefrançaise.nu new file mode 100644 index 0000000..c88d6cd --- /dev/null +++ b/test/target_normalized/alliancefrançaise.nu @@ -0,0 +1 @@ +{"status": ["Active", "ok"], "updated_date": ["2014-01-24T00:00:00"], "contacts": {"admin": {"handle": "qi9c3zbvhr"}, "tech": {"handle": "qi9c3zbvhr"}, "registrant": {"handle": "qi9c3zbvhr"}, "billing": {"handle": "qi9c3zbvhr"}}, "nameservers": ["ns01.hostcontrol.com", "ns02.hostcontrol.com"], "expiration_date": ["2021-06-02T00:00:00"], "creation_date": ["2010-03-02T00:00:00"], "raw": ["# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation). \n# All rights reserved. \n\n# The information obtained through searches, or otherwise, is protected \n# by the Swedish Copyright Act (1960:729) and international conventions. \n# It is also subject to database protection according to the Swedish \n# Copyright Act. \n\n# Any use of this material to target advertising or \n# similar activities is forbidden and will be prosecuted. \n# If any of the information below is transferred to a third \n# party, it must be done in its entirety. This server must \n# not be used as a backend for a search engine. \n\n# Result of search for registered domain names under \n# the .nu top level domain. \n# The data is in the UTF-8 character set and the result is \n# printed with eight bits.\nstate: active\ndomain: xn--alliancefranaise-npb.nu (alliancefran\u00e7aise.nu)\nholder: qi9c3zbvhr\nadmin-c: qi9c3zbvhr\ntech-c: qi9c3zbvhr\nbilling-c: qi9c3zbvhr\ncreated: 2010-03-02\nmodified: 2014-01-24\nexpires: 2021-06-02\nnserver: ns01.hostcontrol.com\nnserver: ns02.hostcontrol.com\ndnssec: unsigned delegation\nstatus: ok\nregistrar: Worldnames, Inc.\n\n"], "registrar": ["Worldnames, Inc."]} \ No newline at end of file diff --git a/test/target_normalized/bäckerei.de b/test/target_normalized/bäckerei.de new file mode 100644 index 0000000..d38e491 --- /dev/null +++ b/test/target_normalized/bäckerei.de @@ -0,0 +1 @@ +{"status": ["Connect"], "updated_date": ["2013-04-03T00:14:26", "2008-05-27T16:56:58"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.parkingcrew.net", "ns2.parkingcrew.net"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: b\u00e4ckerei.de\nDomain-Ace: xn--bckerei-5wa.de\nNserver: ns1.parkingcrew.net\nNserver: ns2.parkingcrew.net\nStatus: connect\nChanged: 2013-04-03T00:14:26+02:00\n\n[Tech-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n[Zone-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n"], "emails": ["jens@mechelke.de"]} \ No newline at end of file From 4eee3b2d1480a27098427e9964651cfeaf554515 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Tue, 18 Feb 2014 17:23:44 +0100 Subject: [PATCH 04/12] added RFC3490 feature documentation --- doc/contribute.html | 30 +++++++++++++++++++++++++++--- doc/index.html | 30 +++++++++++++++++++++++++++--- doc/install.html | 32 ++++++++++++++++++++++++++++---- doc/troubleshoot.html | 30 +++++++++++++++++++++++++++--- doc/upgrade.html | 30 +++++++++++++++++++++++++++--- doc/usage.html | 34 +++++++++++++++++++++++++++++----- doc/usage.zpy | 6 +++++- 7 files changed, 170 insertions(+), 22 deletions(-) diff --git a/doc/contribute.html b/doc/contribute.html index 9ba390e..eb29f51 100644 --- a/doc/contribute.html +++ b/doc/contribute.html @@ -22,20 +22,44 @@ margin-bottom: 32px; } - .example + .example , .section { padding: 5px 6px; font-weight: bold; + margin-top: 11px; + } + + .example + { font-size: 15px; background-color: #E6E6E6; - margin-top: 11px; + } + + .section + { + background-color: #E8E8E8; + } + + .section > .title + { + font-size: 16px; } - .example > .children + .example > .children, .section > .children { padding-top: 11px; padding-left: 10px; } + + .section > .children + { + font-size: 95%; + } + + .section > .children > div.text:first-child, .section > .children > dl:first-child + { + margin-top: 0px; + } .example > .children > h7 { diff --git a/doc/index.html b/doc/index.html index f90b7c6..38f44db 100644 --- a/doc/index.html +++ b/doc/index.html @@ -22,20 +22,44 @@ margin-bottom: 32px; } - .example + .example , .section { padding: 5px 6px; font-weight: bold; + margin-top: 11px; + } + + .example + { font-size: 15px; background-color: #E6E6E6; - margin-top: 11px; + } + + .section + { + background-color: #E8E8E8; + } + + .section > .title + { + font-size: 16px; } - .example > .children + .example > .children, .section > .children { padding-top: 11px; padding-left: 10px; } + + .section > .children + { + font-size: 95%; + } + + .section > .children > div.text:first-child, .section > .children > dl:first-child + { + margin-top: 0px; + } .example > .children > h7 { diff --git a/doc/install.html b/doc/install.html index 8f7b6eb..1a5b5ad 100644 --- a/doc/install.html +++ b/doc/install.html @@ -22,20 +22,44 @@ margin-bottom: 32px; } - .example + .example , .section { padding: 5px 6px; font-weight: bold; + margin-top: 11px; + } + + .example + { font-size: 15px; background-color: #E6E6E6; - margin-top: 11px; + } + + .section + { + background-color: #E8E8E8; + } + + .section > .title + { + font-size: 16px; } - .example > .children + .example > .children, .section > .children { padding-top: 11px; padding-left: 10px; } + + .section > .children + { + font-size: 95%; + } + + .section > .children > div.text:first-child, .section > .children > dl:first-child + { + margin-top: 0px; + } .example > .children > h7 { @@ -156,6 +180,6 @@ -

Installing pythonwhois

To install pythonwhois, you need to have pip installed. It's available on most distributions in a package named python-pip.
The pythonwhois package includes the pwhois tool.

Installing it from scratch

Code:
pip install pythonwhois

Updating from a previous version

Make sure to read the upgrade notes before updating to a new major pythonwhois version!
Code:
pip install --upgrade pythonwhois
+

Installing pythonwhois

To install pythonwhois, you need to have pip installed. It's available on most distributions in a package named python-pip.
The pythonwhois package includes the pwhois tool.

Installing it from scratch

Code:
pip install pythonwhois
If you are using Python 2.6 and get an ImportError about OrderedDict, also do the following:
Code:
pip install ordereddict

Updating from a previous version

Make sure to read the upgrade notes before updating to a new major pythonwhois version!
Code:
pip install --upgrade pythonwhois
diff --git a/doc/troubleshoot.html b/doc/troubleshoot.html index f901b4d..f75b187 100644 --- a/doc/troubleshoot.html +++ b/doc/troubleshoot.html @@ -22,20 +22,44 @@ margin-bottom: 32px; } - .example + .example , .section { padding: 5px 6px; font-weight: bold; + margin-top: 11px; + } + + .example + { font-size: 15px; background-color: #E6E6E6; - margin-top: 11px; + } + + .section + { + background-color: #E8E8E8; + } + + .section > .title + { + font-size: 16px; } - .example > .children + .example > .children, .section > .children { padding-top: 11px; padding-left: 10px; } + + .section > .children + { + font-size: 95%; + } + + .section > .children > div.text:first-child, .section > .children > dl:first-child + { + margin-top: 0px; + } .example > .children > h7 { diff --git a/doc/upgrade.html b/doc/upgrade.html index ed533a8..80d1558 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -22,20 +22,44 @@ margin-bottom: 32px; } - .example + .example , .section { padding: 5px 6px; font-weight: bold; + margin-top: 11px; + } + + .example + { font-size: 15px; background-color: #E6E6E6; - margin-top: 11px; + } + + .section + { + background-color: #E8E8E8; + } + + .section > .title + { + font-size: 16px; } - .example > .children + .example > .children, .section > .children { padding-top: 11px; padding-left: 10px; } + + .section > .children + { + font-size: 95%; + } + + .section > .children > div.text:first-child, .section > .children > dl:first-child + { + margin-top: 0px; + } .example > .children > h7 { diff --git a/doc/usage.html b/doc/usage.html index 4026d99..13889a2 100644 --- a/doc/usage.html +++ b/doc/usage.html @@ -22,20 +22,44 @@ margin-bottom: 32px; } - .example + .example , .section { padding: 5px 6px; font-weight: bold; + margin-top: 11px; + } + + .example + { font-size: 15px; background-color: #E6E6E6; - margin-top: 11px; + } + + .section + { + background-color: #E8E8E8; + } + + .section > .title + { + font-size: 16px; } - .example > .children + .example > .children, .section > .children { padding-top: 11px; padding-left: 10px; } + + .section > .children + { + font-size: 95%; + } + + .section > .children > div.text:first-child, .section > .children > dl:first-child + { + margin-top: 0px; + } .example > .children > h7 { @@ -156,7 +180,7 @@ -

Using pythonwhois

This is a quick usage guide; pythonwhois is pretty simple.

Table of contents

Normalization

Before you start, it's important to understand the normalization functionality in pythonwhois. Since some WHOIS servers return data in all-uppercase or all-lowercase, and some registrants simply use the incorrect case themselves, reading WHOIS data can be a bit unpleasant.
pythonwhois attempts to solve this problem by optionally 'normalizing' WHOIS data. Depending on the kind of field, the parser will try to create a readable and consistent version of the value. The pwhois command-line utility uses normalization by default; when using the Python module it's disabled by default.
Normalization isn't perfect, and you shouldn't rely on it for technical purposes. It's intended for increasing human readability only. If you work with a lot of WHOIS data, it's recommended to turn off normalization or do your own post-processing.

From the commandline

pwhois [--raw] [--json] [-f PATH] DOMAIN
pwhois is the WHOIS tool that is included with pythonwhois. It's really just a script that you can run from your terminal, and that gives you nicely formatted WHOIS output. Normalization is turned on in pwhois by default, so it will try to make the output more readable (by fixing capitalization and such).
Example: Using pwhois
Code:
sh$ pwhois cryto.net
Output:
Status            : clientTransferProhibited
+		

Using pythonwhois

This is a quick usage guide; pythonwhois is pretty simple.

Table of contents

Normalization

Before you start, it's important to understand the normalization functionality in pythonwhois. Since some WHOIS servers return data in all-uppercase or all-lowercase, and some registrants simply use the incorrect case themselves, reading WHOIS data can be a bit unpleasant.
pythonwhois attempts to solve this problem by optionally 'normalizing' WHOIS data. Depending on the kind of field, the parser will try to create a readable and consistent version of the value. The pwhois command-line utility uses normalization by default; when using the Python module it's disabled by default.
Normalization isn't perfect, and you shouldn't rely on it for technical purposes. It's intended for increasing human readability only. If you work with a lot of WHOIS data, it's recommended to turn off normalization or do your own post-processing.

From the commandline

From your Python application

To start using pythonwhois, use import pythonwhois.
pythonwhois.get_whois(domain[, normalized=[]])
Retrieves and parses WHOIS data for a specified domain. Raises pythonwhois.shared.WhoisException if no root server for the TLD could be found.

Arguments

domain
The domain to WHOIS.
normalized
Optional. What data to normalize. By default, no data will be normalized. You can specify either a list of keys to normalize (see also the result reference below), an empty list (to turn off normalization), or True (to turn on normalization for all supported fields).

Returns

A nested structured object, consisting of dicts and lists. The only key that is always present is contacts, but the keys inside the dict that it contains may not be.
id
The Domain ID.
status
A list of current statuses of the domain at the registrar. May contain any string value.
creation_date
A list of datetime.datetime objects representing the creation date(s) of the domain.
expiration_date
A list of datetime.datetime objects representing the expiration date(s) of the domain.
updated_date
A list of datetime.datetime objects representing the update date(s) of the domain. Note that what an 'update date' entails, differs between WHOIS servers. For some, it means the last renewal data. For others, it means the last registrant info update. For yet others, it means the last update of their WHOIS database as a whole. This key is unlikely to be useful, unless you're trying to plot WHOIS data changes over time.
registrar
A list of registrar names. May contain any string value.
whois_server
A list of WHOIS servers refered to. This is unlikely to be a useful list.
nameservers
A list of nameservers for the domain, as indicated by the WHOIS server.
emails
A list of e-mail address for the domain. This list does not include e-mail addresses from registrant data, only e-mail addresses from other places in the WHOIS data such as abuse report instructions.
contacts
A dict containing contacts for the domain, each also a dict. Fields for these contacts are listed further down. If a specific type of contact was not listed for the domain, the key for it will still exist, but it will contain None.
registrant
The registrant or domain holder.
tech
The technical contact for the domain. May be either the registrar, or a party related to the registrant.
admin
The administrative contact for the domain.
billing
The billing contact for the domain.

Contact fields

These are the fields that any contact dict may contain. If certain information for a contact was not found, the corresponding key will be absent.
Important: Note that any of these fields may consist of multiple lines, although the address field is the only one that is likely to consist of multiple lines.
handle
The NIC handle for the contact.
name
The full name of the contact.
organization
The organization or company that the contact belongs to.
street
The street address of the contact (or organization).
postalcode
The postal code of the contact (or organization). This may or may not include a country prefix.
city
The city of the contact (or organization).
state
The state, province, or region of the contact (or organization). The actual values for this field vary widely.
country
The country of the contact (or organization).
email
The e-mail address of the contact (or organization).
phone
The phone number of the contact (or organization), including extension where applicable.
fax
The fax number of the contact (or organization), including extension where applicable.

When you need more control...

+[...]
There are several optional arguments that you can pass to pwhois to make it behave differently.
--raw
When you use this flag, pwhois will not attempt to parse the WHOIS data; it'll just follow redirects and output the raw data, delimited by double dashes (--).
--json
This flag will make pwhois output JSON instead of human-readable output. While not recommended, you can use this if you need parsed data in a non-Python application.
-f PATH
This will make pwhois read and parse WHOIS data from a specified file, instead of actually contacting a WHOIS server. Useful if you get your WHOIS data elsewhere.
Important: Note that when using -f PATH, pwhois will still expect a domain to be specified! What you enter here doesn't really matter, you can also just specify a single dot . for the domain.

From your Python application

To start using pythonwhois, use import pythonwhois.
pythonwhois.get_whois(domain[, normalized=[]])
Retrieves and parses WHOIS data for a specified domain. Raises pythonwhois.shared.WhoisException if no root server for the TLD could be found.

Arguments

domain
The domain to WHOIS.
normalized
Optional. What data to normalize. By default, no data will be normalized. You can specify either a list of keys to normalize (see also the result reference below), an empty list (to turn off normalization), or True (to turn on normalization for all supported fields).

Returns

A nested structured object, consisting of dicts and lists. The only key that is always present is contacts, but the keys inside the dict that it contains may not be.
id
The Domain ID.
status
A list of current statuses of the domain at the registrar. May contain any string value.
creation_date
A list of datetime.datetime objects representing the creation date(s) of the domain.
expiration_date
A list of datetime.datetime objects representing the expiration date(s) of the domain.
updated_date
A list of datetime.datetime objects representing the update date(s) of the domain. Note that what an 'update date' entails, differs between WHOIS servers. For some, it means the last renewal data. For others, it means the last registrant info update. For yet others, it means the last update of their WHOIS database as a whole. This key is unlikely to be useful, unless you're trying to plot WHOIS data changes over time.
registrar
A list of registrar names. May contain any string value.
whois_server
A list of WHOIS servers refered to. This is unlikely to be a useful list.
nameservers
A list of nameservers for the domain, as indicated by the WHOIS server.
emails
A list of e-mail address for the domain. This list does not include e-mail addresses from registrant data, only e-mail addresses from other places in the WHOIS data such as abuse report instructions.
contacts
A dict containing contacts for the domain, each also a dict. Fields for these contacts are listed further down. If a specific type of contact was not listed for the domain, the key for it will still exist, but it will contain None.
registrant
The registrant or domain holder.
tech
The technical contact for the domain. May be either the registrar, or a party related to the registrant.
admin
The administrative contact for the domain.
billing
The billing contact for the domain.

Contact fields

These are the fields that any contact dict may contain. If certain information for a contact was not found, the corresponding key will be absent.
Important: Note that any of these fields may consist of multiple lines, although the address field is the only one that is likely to consist of multiple lines.
handle
The NIC handle for the contact.
name
The full name of the contact.
organization
The organization or company that the contact belongs to.
street
The street address of the contact (or organization).
postalcode
The postal code of the contact (or organization). This may or may not include a country prefix.
city
The city of the contact (or organization).
state
The state, province, or region of the contact (or organization). The actual values for this field vary widely.
country
The country of the contact (or organization).
email
The e-mail address of the contact (or organization).
phone
The phone number of the contact (or organization), including extension where applicable.
fax
The fax number of the contact (or organization), including extension where applicable.

When you need more control...

diff --git a/doc/usage.zpy b/doc/usage.zpy index 2817b4e..6e671d0 100644 --- a/doc/usage.zpy +++ b/doc/usage.zpy @@ -160,7 +160,7 @@ To start using pythonwhois, use `import pythonwhois`. ## When you need more control... -^ pythonwhois.net.get_whois_raw(**domain**[, **server=""**]) +^ pythonwhois.net.get_whois_raw(**domain**[, **server=""**, **rfc3490=True**]) Retrieves the raw WHOIS data for the specified domain, and returns it as a list of responses (one element for each WHOIS server queried). This method will keep following redirects, until it ends up at the right server (and all responses it picks up in the meantime, will be included). Raises `pythonwhois.shared.WhoisException` if no root server for the TLD could be found. @@ -170,6 +170,10 @@ To start using pythonwhois, use `import pythonwhois`. server:: **Optional.** The WHOIS server to query. When not specified, it will default to the appropriate WHOIS server for the TLD. + rfc3490:: + **Optional.** If set to `True` a given domain will be encoded through the **toASCII** method as documented in RFC3490 before its submission to the whois service. If the domain isn't given in unicode, the method will handle the decoding by itself. + + ^ pythonwhois.net.get_root_server(**domain**) Looks up the appropriate root server for a TLD, and returns it as a string. Raises `pythonwhois.shared.WhoisException` if no root server for the TLD could be found. From 73a363eb0002abb89c7ada0a95190c23468b7586 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 17:10:23 +0100 Subject: [PATCH 05/12] partial support of regexpr for .de domains --- pythonwhois/parse.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index c15d6d2..a339383 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -68,7 +68,8 @@ grammar = { 'Last Update\s?[.]*:\s?(?P.+)', 'Last updated on (?P.+) [a-z]{3,4}', 'Last updated:\s*(?P.+)', - 'Last update of whois database:\s?[a-z]{3}, (?P.+) [a-z]{3,4}'], + 'Last update of whois database:\s?[a-z]{3}, (?P.+) [a-z]{3,4}', + 'Changed:\s*(?P.+)'], 'registrar': ['registrar:\s*(?P.+)', 'Registrar:\s*(?P.+)', 'Sponsoring Registrar Organization:\s*(?P.+)', @@ -92,7 +93,8 @@ grammar = { 'NS [0-9]+\s*:\s*(?P.+)', '(?[a-z0-9-]+\.d?ns[0-9]*\.([a-z0-9-]+\.)+[a-z0-9]+)', '(?([a-z0-9-]+\.)+[a-z0-9]+)(\s+([0-9]{1,3}\.){3}[0-9]{1,3})', - '(?d?ns\.([a-z0-9-]+\.)+[a-z0-9]+)'], + '(?d?ns\.([a-z0-9-]+\.)+[a-z0-9]+)', + 'Nserver:\s*(?P.+)'], 'emails': ['(?P[\w.-]+@[\w.-]+\.[\w]{2,6})', # Really need to fix this, much longer TLDs now exist... '(?P[\w.-]+\sAT\s[\w.-]+\sDOT\s[\w]{2,6})'] }, @@ -106,7 +108,8 @@ grammar = { '(?P[0-9]{4})[./-](?P[0-9]{1,2})[./-](?P[0-9]{1,2})', '(?P[0-9]{1,2})[./ -](?P[0-9]{1,2})[./ -](?P[0-9]{4}|[0-9]{2})', '(?PJan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?P[0-9]{1,2}),? (?P[0-9]{4})', - '(?P[0-9]{1,2})-(?PJanuary|February|March|April|May|June|July|August|September|October|November|December)-(?P[0-9]{4})' + '(?P[0-9]{1,2})-(?PJanuary|February|March|April|May|June|July|August|September|October|November|December)-(?P[0-9]{4})', + '(?P[0-9]{4})-(?P[0-9]{2})-(?P[0-9]{2})T(?P[0-9]{2}):(?P[0-9]{2}):(?P[0-9]{2})', ), "_months": { 'jan': 1, From 74ef9a01e42080b0cbafab8d000b021f3d512c11 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 17:47:23 +0100 Subject: [PATCH 06/12] partial support of regexpr for .de domains --- pythonwhois/parse.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index a339383..6d6fc36 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -100,16 +100,15 @@ grammar = { }, "_dateformats": ( '(?P[0-9]{1,2})[./ -](?PJan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[./ -](?P[0-9]{4}|[0-9]{2})' - '(\s+(?P[0-9]{1,2})[:.](?P[0-9]{1,2})[:.](?P[0-9]{1,2}))?', + '(\s+(?P[0-9]{1,2})[:.](?P[0-9]{1,2})[:.](?P[0-9]{1,2}))?', '[a-z]{3}\s(?PJan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[./ -](?P[0-9]{1,2})' - '(\s+(?P[0-9]{1,2})[:.](?P[0-9]{1,2})[:.](?P[0-9]{1,2}))?' - '\s[a-z]{3}\s(?P[0-9]{4}|[0-9]{2})', + '(\s+(?P[0-9]{1,2})[:.](?P[0-9]{1,2})[:.](?P[0-9]{1,2}))?' + '\s[a-z]{3}\s(?P[0-9]{4}|[0-9]{2})', '(?P[0-9]{4})[./-]?(?P[0-9]{2})[./-]?(?P[0-9]{2})(\s|T|/)((?P[0-9]{1,2})[:.](?P[0-9]{1,2})[:.](?P[0-9]{1,2}))', '(?P[0-9]{4})[./-](?P[0-9]{1,2})[./-](?P[0-9]{1,2})', '(?P[0-9]{1,2})[./ -](?P[0-9]{1,2})[./ -](?P[0-9]{4}|[0-9]{2})', '(?PJan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?P[0-9]{1,2}),? (?P[0-9]{4})', '(?P[0-9]{1,2})-(?PJanuary|February|March|April|May|June|July|August|September|October|November|December)-(?P[0-9]{4})', - '(?P[0-9]{4})-(?P[0-9]{2})-(?P[0-9]{2})T(?P[0-9]{2}):(?P[0-9]{2}):(?P[0-9]{2})', ), "_months": { 'jan': 1, From 2f5e700224adf67e8414d7d49954979c07df2eb3 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 19:29:08 +0100 Subject: [PATCH 07/12] full regexpr support for .de domains and updated test-cases for prq.se + nic.ru --- pythonwhois/parse.py | 7 ++++--- test/target_default/bäckerei.de | 2 +- test/target_default/nic.ru | 2 +- test/target_default/prq.se | 2 +- test/target_default/test.de | 2 +- test/target_normalized/bäckerei.de | 2 +- test/target_normalized/nic.ru | 2 +- test/target_normalized/prq.se | 2 +- test/target_normalized/test.de | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index 6d6fc36..9a0c51f 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -64,12 +64,11 @@ grammar = { 'Domain Last Updated Date\s?[.]*:\s?(?P.+)', 'Record last updated\s?[.]*:\s?(?P.+)', 'Modified\s?[.]*:\s?(?P.+)', - 'changed:\s*(?P.+)', + '(C|c)hanged:\s*(?P.+)', 'Last Update\s?[.]*:\s?(?P.+)', 'Last updated on (?P.+) [a-z]{3,4}', 'Last updated:\s*(?P.+)', - 'Last update of whois database:\s?[a-z]{3}, (?P.+) [a-z]{3,4}', - 'Changed:\s*(?P.+)'], + 'Last update of whois database:\s?[a-z]{3}, (?P.+) [a-z]{3,4}'], 'registrar': ['registrar:\s*(?P.+)', 'Registrar:\s*(?P.+)', 'Sponsoring Registrar Organization:\s*(?P.+)', @@ -493,6 +492,7 @@ def parse_registrants(data): "Technical contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Admin Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Technical contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am + "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\+.]+)\nFax: (?P[0-9\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC ] admin_contact_regexes = [ @@ -512,6 +512,7 @@ def parse_registrants(data): "Administrative contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Tech Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Administrative contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am + "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\+.]+)\nFax: (?P[0-9\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC ] billing_contact_regexes = [ diff --git a/test/target_default/bäckerei.de b/test/target_default/bäckerei.de index 706962a..dda5536 100644 --- a/test/target_default/bäckerei.de +++ b/test/target_default/bäckerei.de @@ -1 +1 @@ -{"status": ["connect"], "updated_date": ["2013-04-03T00:14:26", "2008-05-27T16:56:58"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.parkingcrew.net", "ns2.parkingcrew.net"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: b\u00e4ckerei.de\nDomain-Ace: xn--bckerei-5wa.de\nNserver: ns1.parkingcrew.net\nNserver: ns2.parkingcrew.net\nStatus: connect\nChanged: 2013-04-03T00:14:26+02:00\n\n[Tech-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n[Zone-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n"], "emails": ["jens@mechelke.de"]} \ No newline at end of file +{"status": ["connect"], "updated_date": ["2013-04-03T00:14:26", "2008-05-27T16:56:58"], "contacts": {"admin": {"city": "Lilienthal", "fax": "+49.4298939488", "name": "Mechelke Jens", "country": "DE", "changed": "2008-05-27T16:56:58+02:00", "phone": "+49.4298939487", "street": "Heidberger Strasse 1a", "postalcode": "28865", "type": "PERSON", "email": "jens@mechelke.de"}, "tech": {"city": "Lilienthal", "fax": "+49.4298939488", "name": "Mechelke Jens", "country": "DE", "changed": "2008-05-27T16:56:58+02:00", "phone": "+49.4298939487", "street": "Heidberger Strasse 1a", "postalcode": "28865", "type": "PERSON", "email": "jens@mechelke.de"}, "registrant": null, "billing": null}, "nameservers": ["ns1.parkingcrew.net", "ns2.parkingcrew.net"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: b\u00e4ckerei.de\nDomain-Ace: xn--bckerei-5wa.de\nNserver: ns1.parkingcrew.net\nNserver: ns2.parkingcrew.net\nStatus: connect\nChanged: 2013-04-03T00:14:26+02:00\n\n[Tech-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n[Zone-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n"]} \ No newline at end of file diff --git a/test/target_default/nic.ru b/test/target_default/nic.ru index 139f96d..939733e 100644 --- a/test/target_default/nic.ru +++ b/test/target_default/nic.ru @@ -1 +1 @@ -{"status": ["REGISTERED, DELEGATED, VERIFIED"], "updated_date": ["2013-11-20T08:41:39"], "contacts": {"admin": null, "tech": null, "registrant": {"organization": "JSC 'RU-CENTER'"}, "billing": null}, "nameservers": ["ns4-cloud.nic.ru", "ns5.nic.ru", "ns6.nic.ru", "ns7.nic.ru", "ns8-cloud.nic.ru"], "expiration_date": ["2013-12-01T00:00:00"], "creation_date": ["1997-11-28T00:00:00"], "raw": ["% By submitting a query to RIPN's Whois Service\n% you agree to abide by the following terms of use:\n% http://www.ripn.net/about/servpol.html#3.2 (in Russian) \n% http://www.ripn.net/about/en/servpol.html#3.2 (in English).\n\ndomain: NIC.RU\nnserver: ns4-cloud.nic.ru. 195.253.65.2, 2a01:5b0:5::2\nnserver: ns5.nic.ru. 31.177.67.100, 2a02:2090:e800:9000:31:177:67:100\nnserver: ns6.nic.ru. 31.177.74.100, 2a02:2090:ec00:9040:31:177:74:100\nnserver: ns7.nic.ru. 31.177.71.100, 2a02:2090:ec00:9000:31:177:71:100\nnserver: ns8-cloud.nic.ru. 195.253.64.10, 2a01:5b0:4::a\nstate: REGISTERED, DELEGATED, VERIFIED\norg: JSC 'RU-CENTER'\nregistrar: RU-CENTER-REG-RIPN\nadmin-contact: https://www.nic.ru/whois\ncreated: 1997.11.28\npaid-till: 2013.12.01\nfree-date: 2014.01.01\nsource: TCI\n\nLast updated on 2013.11.20 08:41:39 MSK\n\n"], "registrar": ["RU-CENTER-REG-RIPN"]} \ No newline at end of file +{"status": ["REGISTERED, DELEGATED, VERIFIED"], "updated_date": ["2013-11-20T08:41:39"], "contacts": {"admin": null, "tech": null, "registrant": {"organization": "JSC 'RU-CENTER'"}, "billing": null}, "nameservers": ["ns4-cloud.nic.ru", "ns4-cloud.nic.ru. 195.253.65.2, 2a01:5b0:5::2", "ns5.nic.ru", "ns5.nic.ru. 31.177.67.100, 2a02:2090:e800:9000:31:177:67:100", "ns6.nic.ru", "ns6.nic.ru. 31.177.74.100, 2a02:2090:ec00:9040:31:177:74:100", "ns7.nic.ru", "ns7.nic.ru. 31.177.71.100, 2a02:2090:ec00:9000:31:177:71:100", "ns8-cloud.nic.ru", "ns8-cloud.nic.ru. 195.253.64.10, 2a01:5b0:4::a"], "expiration_date": ["2013-12-01T00:00:00"], "creation_date": ["1997-11-28T00:00:00"], "raw": ["% By submitting a query to RIPN's Whois Service\n% you agree to abide by the following terms of use:\n% http://www.ripn.net/about/servpol.html#3.2 (in Russian) \n% http://www.ripn.net/about/en/servpol.html#3.2 (in English).\n\ndomain: NIC.RU\nnserver: ns4-cloud.nic.ru. 195.253.65.2, 2a01:5b0:5::2\nnserver: ns5.nic.ru. 31.177.67.100, 2a02:2090:e800:9000:31:177:67:100\nnserver: ns6.nic.ru. 31.177.74.100, 2a02:2090:ec00:9040:31:177:74:100\nnserver: ns7.nic.ru. 31.177.71.100, 2a02:2090:ec00:9000:31:177:71:100\nnserver: ns8-cloud.nic.ru. 195.253.64.10, 2a01:5b0:4::a\nstate: REGISTERED, DELEGATED, VERIFIED\norg: JSC 'RU-CENTER'\nregistrar: RU-CENTER-REG-RIPN\nadmin-contact: https://www.nic.ru/whois\ncreated: 1997.11.28\npaid-till: 2013.12.01\nfree-date: 2014.01.01\nsource: TCI\n\nLast updated on 2013.11.20 08:41:39 MSK\n\n"], "registrar": ["RU-CENTER-REG-RIPN"]} \ No newline at end of file diff --git a/test/target_default/prq.se b/test/target_default/prq.se index fe7caf7..6f2c835 100644 --- a/test/target_default/prq.se +++ b/test/target_default/prq.se @@ -1 +1 @@ -{"status": ["active", "ok"], "updated_date": ["2012-11-03T00:00:00"], "contacts": {"admin": null, "tech": null, "registrant": {"handle": "perper9352-00001"}, "billing": null}, "nameservers": ["ns.prq.se", "ns2.prq.se"], "expiration_date": ["2015-06-14T00:00:00"], "creation_date": ["2004-06-14T00:00:00"], "raw": ["# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation).\n# All rights reserved.\n\n# The information obtained through searches, or otherwise, is protected\n# by the Swedish Copyright Act (1960:729) and international conventions.\n# It is also subject to database protection according to the Swedish\n# Copyright Act.\n\n# Any use of this material to target advertising or\n# similar activities is forbidden and will be prosecuted.\n# If any of the information below is transferred to a third\n# party, it must be done in its entirety. This server must\n# not be used as a backend for a search engine.\n\n# Result of search for registered domain names under\n# the .SE top level domain.\n\n# The data is in the UTF-8 character set and the result is\n# printed with eight bits.\n\nstate: active\ndomain: prq.se\nholder: perper9352-00001\nadmin-c: -\ntech-c: -\nbilling-c: -\ncreated: 2004-06-14\nmodified: 2012-11-03\nexpires: 2015-06-14\ntransferred: 2012-08-09\nnserver: ns.prq.se 193.104.214.194\nnserver: ns2.prq.se 88.80.30.194\ndnssec: unsigned delegation\nstatus: ok\nregistrar: AEB Komm\n\n"], "registrar": ["AEB Komm"]} \ No newline at end of file +{"status": ["active", "ok"], "updated_date": ["2012-11-03T00:00:00"], "contacts": {"admin": null, "tech": null, "registrant": {"handle": "perper9352-00001"}, "billing": null}, "nameservers": ["ns.prq.se", "ns.prq.se 193.104.214.194", "ns2.prq.se", "ns2.prq.se 88.80.30.194"], "expiration_date": ["2015-06-14T00:00:00"], "creation_date": ["2004-06-14T00:00:00"], "raw": ["# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation).\n# All rights reserved.\n\n# The information obtained through searches, or otherwise, is protected\n# by the Swedish Copyright Act (1960:729) and international conventions.\n# It is also subject to database protection according to the Swedish\n# Copyright Act.\n\n# Any use of this material to target advertising or\n# similar activities is forbidden and will be prosecuted.\n# If any of the information below is transferred to a third\n# party, it must be done in its entirety. This server must\n# not be used as a backend for a search engine.\n\n# Result of search for registered domain names under\n# the .SE top level domain.\n\n# The data is in the UTF-8 character set and the result is\n# printed with eight bits.\n\nstate: active\ndomain: prq.se\nholder: perper9352-00001\nadmin-c: -\ntech-c: -\nbilling-c: -\ncreated: 2004-06-14\nmodified: 2012-11-03\nexpires: 2015-06-14\ntransferred: 2012-08-09\nnserver: ns.prq.se 193.104.214.194\nnserver: ns2.prq.se 88.80.30.194\ndnssec: unsigned delegation\nstatus: ok\nregistrar: AEB Komm\n\n"], "registrar": ["AEB Komm"]} \ No newline at end of file diff --git a/test/target_default/test.de b/test/target_default/test.de index 8623077..1c5a30b 100644 --- a/test/target_default/test.de +++ b/test/target_default/test.de @@ -1 +1 @@ -{"status": ["connect"], "updated_date": ["2013-04-10T11:11:41", "2013-03-19T14:16:18", "2013-08-05T11:43:45"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["dns.iwelt-ag.net", "dns2.iwelt-ag.net", "dns3.iwelt-ag.de"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: test.de\nNserver: dns.iwelt-ag.net\nNserver: dns2.iwelt-ag.net\nNserver: dns3.iwelt-ag.de\nStatus: connect\nChanged: 2013-04-10T11:11:41+02:00\n\n[Tech-C]\nType: PERSON\nName: Christian Zantop\nOrganisation: Stiftung Warentest\nAddress: Luetzowplatz 11-13\nPostalCode: 10785\nCity: Berlin\nCountryCode: DE\nPhone: +49.3026312604\nFax: +49.3026312342\nEmail: webmaster@stiftung-warentest.de\nChanged: 2013-03-19T14:16:18+01:00\n\n[Zone-C]\nType: ROLE\nName: Domainservice\nOrganisation: iWelt AG\nAddress: Mainparkring 4\nPostalCode: 97246\nCity: Eibelstadt\nCountryCode: DE\nPhone: +49.9303982860\nFax: +49.9303982879\nEmail: support@iwelt.de\nChanged: 2013-08-05T11:43:45+02:00\n\n"], "emails": ["webmaster@stiftung-warentest.de", "support@iwelt.de"]} \ No newline at end of file +{"status": ["connect"], "updated_date": ["2013-04-10T11:11:41", "2013-03-19T14:16:18", "2013-08-05T11:43:45"], "contacts": {"admin": {"city": "Berlin", "fax": "+49.3026312342", "name": "Christian Zantop", "country": "DE", "changed": "2013-03-19T14:16:18+01:00", "phone": "+49.3026312604", "street": "Luetzowplatz 11-13", "postalcode": "10785", "organization": "Stiftung Warentest", "type": "PERSON", "email": "webmaster@stiftung-warentest.de"}, "tech": {"city": "Eibelstadt", "fax": "+49.9303982879", "name": "Domainservice", "country": "DE", "changed": "2013-08-05T11:43:45+02:00", "phone": "+49.9303982860", "street": "Mainparkring 4", "postalcode": "97246", "organization": "iWelt AG", "type": "ROLE", "email": "support@iwelt.de"}, "registrant": null, "billing": null}, "nameservers": ["dns.iwelt-ag.net", "dns2.iwelt-ag.net", "dns3.iwelt-ag.de"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: test.de\nNserver: dns.iwelt-ag.net\nNserver: dns2.iwelt-ag.net\nNserver: dns3.iwelt-ag.de\nStatus: connect\nChanged: 2013-04-10T11:11:41+02:00\n\n[Tech-C]\nType: PERSON\nName: Christian Zantop\nOrganisation: Stiftung Warentest\nAddress: Luetzowplatz 11-13\nPostalCode: 10785\nCity: Berlin\nCountryCode: DE\nPhone: +49.3026312604\nFax: +49.3026312342\nEmail: webmaster@stiftung-warentest.de\nChanged: 2013-03-19T14:16:18+01:00\n\n[Zone-C]\nType: ROLE\nName: Domainservice\nOrganisation: iWelt AG\nAddress: Mainparkring 4\nPostalCode: 97246\nCity: Eibelstadt\nCountryCode: DE\nPhone: +49.9303982860\nFax: +49.9303982879\nEmail: support@iwelt.de\nChanged: 2013-08-05T11:43:45+02:00\n\n"]} \ No newline at end of file diff --git a/test/target_normalized/bäckerei.de b/test/target_normalized/bäckerei.de index d38e491..63f4cff 100644 --- a/test/target_normalized/bäckerei.de +++ b/test/target_normalized/bäckerei.de @@ -1 +1 @@ -{"status": ["Connect"], "updated_date": ["2013-04-03T00:14:26", "2008-05-27T16:56:58"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["ns1.parkingcrew.net", "ns2.parkingcrew.net"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: b\u00e4ckerei.de\nDomain-Ace: xn--bckerei-5wa.de\nNserver: ns1.parkingcrew.net\nNserver: ns2.parkingcrew.net\nStatus: connect\nChanged: 2013-04-03T00:14:26+02:00\n\n[Tech-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n[Zone-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n"], "emails": ["jens@mechelke.de"]} \ No newline at end of file +{"status": ["Connect"], "updated_date": ["2013-04-03T00:14:26", "2008-05-27T16:56:58"], "contacts": {"admin": {"city": "Lilienthal", "fax": "+49.4298939488", "name": "Mechelke Jens", "country": "DE", "changed": "2008-05-27T16:56:58+02:00", "phone": "+49.4298939487", "street": "Heidberger Strasse 1a", "postalcode": "28865", "type": "PERSON", "email": "jens@mechelke.de"}, "tech": {"city": "Lilienthal", "fax": "+49.4298939488", "name": "Mechelke Jens", "country": "DE", "changed": "2008-05-27T16:56:58+02:00", "phone": "+49.4298939487", "street": "Heidberger Strasse 1a", "postalcode": "28865", "type": "PERSON", "email": "jens@mechelke.de"}, "registrant": null, "billing": null}, "nameservers": ["ns1.parkingcrew.net", "ns2.parkingcrew.net"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: b\u00e4ckerei.de\nDomain-Ace: xn--bckerei-5wa.de\nNserver: ns1.parkingcrew.net\nNserver: ns2.parkingcrew.net\nStatus: connect\nChanged: 2013-04-03T00:14:26+02:00\n\n[Tech-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n[Zone-C]\nType: PERSON\nName: Mechelke Jens\nAddress: Heidberger Strasse 1a\nPostalCode: 28865\nCity: Lilienthal\nCountryCode: DE\nPhone: +49.4298939487\nFax: +49.4298939488\nEmail: jens@mechelke.de\nChanged: 2008-05-27T16:56:58+02:00\n\n"]} \ No newline at end of file diff --git a/test/target_normalized/nic.ru b/test/target_normalized/nic.ru index ac14124..512bbfe 100644 --- a/test/target_normalized/nic.ru +++ b/test/target_normalized/nic.ru @@ -1 +1 @@ -{"status": ["Registered, Delegated, Verified"], "updated_date": ["2013-11-20T08:41:39"], "contacts": {"admin": null, "tech": null, "registrant": {"organization": "Jsc 'ru-center'"}, "billing": null}, "nameservers": ["ns4-cloud.nic.ru", "ns5.nic.ru", "ns6.nic.ru", "ns7.nic.ru", "ns8-cloud.nic.ru"], "expiration_date": ["2013-12-01T00:00:00"], "creation_date": ["1997-11-28T00:00:00"], "raw": ["% By submitting a query to RIPN's Whois Service\n% you agree to abide by the following terms of use:\n% http://www.ripn.net/about/servpol.html#3.2 (in Russian) \n% http://www.ripn.net/about/en/servpol.html#3.2 (in English).\n\ndomain: NIC.RU\nnserver: ns4-cloud.nic.ru. 195.253.65.2, 2a01:5b0:5::2\nnserver: ns5.nic.ru. 31.177.67.100, 2a02:2090:e800:9000:31:177:67:100\nnserver: ns6.nic.ru. 31.177.74.100, 2a02:2090:ec00:9040:31:177:74:100\nnserver: ns7.nic.ru. 31.177.71.100, 2a02:2090:ec00:9000:31:177:71:100\nnserver: ns8-cloud.nic.ru. 195.253.64.10, 2a01:5b0:4::a\nstate: REGISTERED, DELEGATED, VERIFIED\norg: JSC 'RU-CENTER'\nregistrar: RU-CENTER-REG-RIPN\nadmin-contact: https://www.nic.ru/whois\ncreated: 1997.11.28\npaid-till: 2013.12.01\nfree-date: 2014.01.01\nsource: TCI\n\nLast updated on 2013.11.20 08:41:39 MSK\n\n"], "registrar": ["Ru-center-reg-ripn"]} \ No newline at end of file +{"status": ["Registered, Delegated, Verified"], "updated_date": ["2013-11-20T08:41:39"], "contacts": {"admin": null, "tech": null, "registrant": {"organization": "Jsc 'ru-center'"}, "billing": null}, "nameservers": ["ns4-cloud.nic.ru", "ns4-cloud.nic.ru. 195.253.65.2, 2a01:5b0:5::2", "ns5.nic.ru", "ns5.nic.ru. 31.177.67.100, 2a02:2090:e800:9000:31:177:67:100", "ns6.nic.ru", "ns6.nic.ru. 31.177.74.100, 2a02:2090:ec00:9040:31:177:74:100", "ns7.nic.ru", "ns7.nic.ru. 31.177.71.100, 2a02:2090:ec00:9000:31:177:71:100", "ns8-cloud.nic.ru", "ns8-cloud.nic.ru. 195.253.64.10, 2a01:5b0:4::a"], "expiration_date": ["2013-12-01T00:00:00"], "creation_date": ["1997-11-28T00:00:00"], "raw": ["% By submitting a query to RIPN's Whois Service\n% you agree to abide by the following terms of use:\n% http://www.ripn.net/about/servpol.html#3.2 (in Russian) \n% http://www.ripn.net/about/en/servpol.html#3.2 (in English).\n\ndomain: NIC.RU\nnserver: ns4-cloud.nic.ru. 195.253.65.2, 2a01:5b0:5::2\nnserver: ns5.nic.ru. 31.177.67.100, 2a02:2090:e800:9000:31:177:67:100\nnserver: ns6.nic.ru. 31.177.74.100, 2a02:2090:ec00:9040:31:177:74:100\nnserver: ns7.nic.ru. 31.177.71.100, 2a02:2090:ec00:9000:31:177:71:100\nnserver: ns8-cloud.nic.ru. 195.253.64.10, 2a01:5b0:4::a\nstate: REGISTERED, DELEGATED, VERIFIED\norg: JSC 'RU-CENTER'\nregistrar: RU-CENTER-REG-RIPN\nadmin-contact: https://www.nic.ru/whois\ncreated: 1997.11.28\npaid-till: 2013.12.01\nfree-date: 2014.01.01\nsource: TCI\n\nLast updated on 2013.11.20 08:41:39 MSK\n\n"], "registrar": ["Ru-center-reg-ripn"]} \ No newline at end of file diff --git a/test/target_normalized/prq.se b/test/target_normalized/prq.se index 8ee2bfc..45c697a 100644 --- a/test/target_normalized/prq.se +++ b/test/target_normalized/prq.se @@ -1 +1 @@ -{"status": ["Active", "ok"], "updated_date": ["2012-11-03T00:00:00"], "contacts": {"admin": null, "tech": null, "registrant": {"handle": "perper9352-00001"}, "billing": null}, "nameservers": ["ns.prq.se", "ns2.prq.se"], "expiration_date": ["2015-06-14T00:00:00"], "creation_date": ["2004-06-14T00:00:00"], "raw": ["# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation).\n# All rights reserved.\n\n# The information obtained through searches, or otherwise, is protected\n# by the Swedish Copyright Act (1960:729) and international conventions.\n# It is also subject to database protection according to the Swedish\n# Copyright Act.\n\n# Any use of this material to target advertising or\n# similar activities is forbidden and will be prosecuted.\n# If any of the information below is transferred to a third\n# party, it must be done in its entirety. This server must\n# not be used as a backend for a search engine.\n\n# Result of search for registered domain names under\n# the .SE top level domain.\n\n# The data is in the UTF-8 character set and the result is\n# printed with eight bits.\n\nstate: active\ndomain: prq.se\nholder: perper9352-00001\nadmin-c: -\ntech-c: -\nbilling-c: -\ncreated: 2004-06-14\nmodified: 2012-11-03\nexpires: 2015-06-14\ntransferred: 2012-08-09\nnserver: ns.prq.se 193.104.214.194\nnserver: ns2.prq.se 88.80.30.194\ndnssec: unsigned delegation\nstatus: ok\nregistrar: AEB Komm\n\n"], "registrar": ["AEB Komm"]} \ No newline at end of file +{"status": ["Active", "ok"], "updated_date": ["2012-11-03T00:00:00"], "contacts": {"admin": null, "tech": null, "registrant": {"handle": "perper9352-00001"}, "billing": null}, "nameservers": ["ns.prq.se", "ns.prq.se 193.104.214.194", "ns2.prq.se", "ns2.prq.se 88.80.30.194"], "expiration_date": ["2015-06-14T00:00:00"], "creation_date": ["2004-06-14T00:00:00"], "raw": ["# Copyright (c) 1997- .SE (The Internet Infrastructure Foundation).\n# All rights reserved.\n\n# The information obtained through searches, or otherwise, is protected\n# by the Swedish Copyright Act (1960:729) and international conventions.\n# It is also subject to database protection according to the Swedish\n# Copyright Act.\n\n# Any use of this material to target advertising or\n# similar activities is forbidden and will be prosecuted.\n# If any of the information below is transferred to a third\n# party, it must be done in its entirety. This server must\n# not be used as a backend for a search engine.\n\n# Result of search for registered domain names under\n# the .SE top level domain.\n\n# The data is in the UTF-8 character set and the result is\n# printed with eight bits.\n\nstate: active\ndomain: prq.se\nholder: perper9352-00001\nadmin-c: -\ntech-c: -\nbilling-c: -\ncreated: 2004-06-14\nmodified: 2012-11-03\nexpires: 2015-06-14\ntransferred: 2012-08-09\nnserver: ns.prq.se 193.104.214.194\nnserver: ns2.prq.se 88.80.30.194\ndnssec: unsigned delegation\nstatus: ok\nregistrar: AEB Komm\n\n"], "registrar": ["AEB Komm"]} \ No newline at end of file diff --git a/test/target_normalized/test.de b/test/target_normalized/test.de index c403680..3d76fe0 100644 --- a/test/target_normalized/test.de +++ b/test/target_normalized/test.de @@ -1 +1 @@ -{"status": ["Connect"], "updated_date": ["2013-04-10T11:11:41", "2013-03-19T14:16:18", "2013-08-05T11:43:45"], "contacts": {"admin": null, "tech": null, "registrant": null, "billing": null}, "nameservers": ["dns.iwelt-ag.net", "dns2.iwelt-ag.net", "dns3.iwelt-ag.de"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: test.de\nNserver: dns.iwelt-ag.net\nNserver: dns2.iwelt-ag.net\nNserver: dns3.iwelt-ag.de\nStatus: connect\nChanged: 2013-04-10T11:11:41+02:00\n\n[Tech-C]\nType: PERSON\nName: Christian Zantop\nOrganisation: Stiftung Warentest\nAddress: Luetzowplatz 11-13\nPostalCode: 10785\nCity: Berlin\nCountryCode: DE\nPhone: +49.3026312604\nFax: +49.3026312342\nEmail: webmaster@stiftung-warentest.de\nChanged: 2013-03-19T14:16:18+01:00\n\n[Zone-C]\nType: ROLE\nName: Domainservice\nOrganisation: iWelt AG\nAddress: Mainparkring 4\nPostalCode: 97246\nCity: Eibelstadt\nCountryCode: DE\nPhone: +49.9303982860\nFax: +49.9303982879\nEmail: support@iwelt.de\nChanged: 2013-08-05T11:43:45+02:00\n\n"], "emails": ["webmaster@stiftung-warentest.de", "support@iwelt.de"]} \ No newline at end of file +{"status": ["Connect"], "updated_date": ["2013-04-10T11:11:41", "2013-03-19T14:16:18", "2013-08-05T11:43:45"], "contacts": {"admin": {"city": "Berlin", "fax": "+49.3026312342", "name": "Christian Zantop", "country": "DE", "changed": "2013-03-19T14:16:18+01:00", "phone": "+49.3026312604", "street": "Luetzowplatz 11-13", "postalcode": "10785", "organization": "Stiftung Warentest", "type": "PERSON", "email": "webmaster@stiftung-warentest.de"}, "tech": {"city": "Eibelstadt", "fax": "+49.9303982879", "name": "Domainservice", "country": "DE", "changed": "2013-08-05T11:43:45+02:00", "phone": "+49.9303982860", "street": "Mainparkring 4", "postalcode": "97246", "organization": "iWelt AG", "type": "ROLE", "email": "support@iwelt.de"}, "registrant": null, "billing": null}, "nameservers": ["dns.iwelt-ag.net", "dns2.iwelt-ag.net", "dns3.iwelt-ag.de"], "raw": ["% Copyright (c) 2010 by DENIC\n% Version: 2.0\n% \n% Restricted rights.\n% \n% Terms and Conditions of Use\n% \n% The data in this record is provided by DENIC for informational purposes only.\n% DENIC does not guarantee its accuracy and cannot, under any circumstances,\n% be held liable in case the stored information would prove to be wrong,\n% incomplete or not accurate in any sense.\n% \n% All the domain data that is visible in the whois service is protected by law.\n% It is not permitted to use it for any purpose other than technical or\n% administrative requirements associated with the operation of the Internet.\n% It is explicitly forbidden to extract, copy and/or use or re-utilise in any\n% form and by any means (electronically or not) the whole or a quantitatively\n% or qualitatively substantial part of the contents of the whois database\n% without prior and explicit written permission by DENIC.\n% It is prohibited, in particular, to use it for transmission of unsolicited\n% and/or commercial and/or advertising by phone, fax, e-mail or for any similar\n% purposes.\n% \n% By maintaining the connection you assure that you have a legitimate interest\n% in the data and that you will only use it for the stated purposes. You are\n% aware that DENIC maintains the right to initiate legal proceedings against\n% you in the event of any breach of this assurance and to bar you from using\n% its whois service.\n% \n% The DENIC whois service on port 43 never discloses any information concerning\n% the domain holder/administrative contact. Information concerning the domain\n% holder/administrative contact can be obtained through use of our web-based\n% whois service available at the DENIC website:\n% http://www.denic.de/en/domains/whois-service/web-whois.html\n% \n\nDomain: test.de\nNserver: dns.iwelt-ag.net\nNserver: dns2.iwelt-ag.net\nNserver: dns3.iwelt-ag.de\nStatus: connect\nChanged: 2013-04-10T11:11:41+02:00\n\n[Tech-C]\nType: PERSON\nName: Christian Zantop\nOrganisation: Stiftung Warentest\nAddress: Luetzowplatz 11-13\nPostalCode: 10785\nCity: Berlin\nCountryCode: DE\nPhone: +49.3026312604\nFax: +49.3026312342\nEmail: webmaster@stiftung-warentest.de\nChanged: 2013-03-19T14:16:18+01:00\n\n[Zone-C]\nType: ROLE\nName: Domainservice\nOrganisation: iWelt AG\nAddress: Mainparkring 4\nPostalCode: 97246\nCity: Eibelstadt\nCountryCode: DE\nPhone: +49.9303982860\nFax: +49.9303982879\nEmail: support@iwelt.de\nChanged: 2013-08-05T11:43:45+02:00\n\n"]} \ No newline at end of file From 4ddee4199cfff3c28478e81a1649d514622ae02a Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 19:39:42 +0100 Subject: [PATCH 08/12] phone + fax can contain spaces (even if they shouldn't according to docu) --- pythonwhois/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index 9a0c51f..cd26919 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -492,7 +492,7 @@ def parse_registrants(data): "Technical contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Admin Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Technical contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\+.]+)\nFax: (?P[0-9\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC + "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC ] admin_contact_regexes = [ @@ -512,7 +512,7 @@ def parse_registrants(data): "Administrative contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Tech Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Administrative contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\+.]+)\nFax: (?P[0-9\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC + "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC ] billing_contact_regexes = [ From d945fe2d34fd7b962a09ae0e7b01700e71dd6e96 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 19:52:49 +0100 Subject: [PATCH 09/12] aaaand there is a comment field called remarks...sometimes... --- pythonwhois/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index cd26919..eb4b5fa 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -492,7 +492,7 @@ def parse_registrants(data): "Technical contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Admin Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Technical contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC + "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n)Changed: (?P.+)", # DeNIC ] admin_contact_regexes = [ @@ -512,7 +512,7 @@ def parse_registrants(data): "Administrative contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Tech Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Administrative contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\nChanged: (?P.+)", # DeNIC + "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] billing_contact_regexes = [ From 99a6f8bc437378a3c2d91942d46e9136dbc00402 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 19:59:17 +0100 Subject: [PATCH 10/12] well, now it doesn't matter which letters are in a phone/fax as they are different from domain to domain --- pythonwhois/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index eb4b5fa..aecf8be 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -492,7 +492,7 @@ def parse_registrants(data): "Technical contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Admin Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Technical contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n)Changed: (?P.+)", # DeNIC + "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] admin_contact_regexes = [ @@ -512,7 +512,7 @@ def parse_registrants(data): "Administrative contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Tech Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Administrative contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P[0-9\s\+.]+)\nFax: (?P[0-9\s\+.]+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC + "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] billing_contact_regexes = [ From c934d6ba9b89101d915dc3ed491d03dda6a74300 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 28 Feb 2014 20:20:58 +0100 Subject: [PATCH 11/12] Last addition, promised. In rare cases there can be 1..n Address-Fields returned from DeNIC --- pythonwhois/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index aecf8be..0797155 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -492,7 +492,7 @@ def parse_registrants(data): "Technical contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Admin Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Technical contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC + "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}(Address: (?P.+)\n)+PostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] admin_contact_regexes = [ @@ -512,7 +512,7 @@ def parse_registrants(data): "Administrative contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Tech Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Administrative contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}Address: (?P.+)\nPostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC + "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}(Address: (?P.+)\n)+PostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] billing_contact_regexes = [ From cfe36ed2f6c3fd1e9f53d2cd30487426334bb201 Mon Sep 17 00:00:00 2001 From: Christian Koepp Date: Fri, 7 Mar 2014 13:05:14 +0100 Subject: [PATCH 12/12] added support for 1..4 address-fields on tld .de --- pythonwhois/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index 0797155..4579aa4 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -492,7 +492,7 @@ def parse_registrants(data): "Technical contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Admin Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Technical contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}(Address: (?P.+)\n)+PostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC + "\[Zone-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}(Address: (?P.+)\n){1}(Address: (?P.+)\n){0,1}(Address: (?P.+)\n){0,1}(Address: (?P.+)\n){0,1}PostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] admin_contact_regexes = [ @@ -512,7 +512,7 @@ def parse_registrants(data): "Administrative contact:\n(?: (?P.+)\n)? (?P.+)\n (?P.+)\n (?P.+)\n (?P.+), (?P.+) (?P.+) (?P.+)\n Phone: (?P.*)\n Fax: (?P.*)\n", # Fabulous.com "Tech Contact Information :[ ]*\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n[ ]+(?P.*)\n\n", # GAL Communication " Administrative contact:\n (?P.+)\n (?P.*)\n (?P.+)\n (?P.+) (?P\S+),[ ]+(?P.+)\n (?P.+)\n (?P.+)\n (?P.*)\n (?P.*)", # .am - "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}(Address: (?P.+)\n)+PostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC + "\[Tech-C\]\nType: (?P.+)\nName: (?P.+)\n(Organisation: (?P.+)\n){0,1}(Address: (?P.+)\n){1}(Address: (?P.+)\n){0,1}(Address: (?P.+)\n){0,1}(Address: (?P.+)\n){0,1}PostalCode: (?P.+)\nCity: (?P.+)\nCountryCode: (?P[A-Za-z]{2})\nPhone: (?P.+)\nFax: (?P.+)\nEmail: (?P.+)\n(Remarks: (?P.+)\n){0,1}Changed: (?P.+)", # DeNIC ] billing_contact_regexes = [