From 056743370a790bec7eb5f57a3f5c01dad8803e2c Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 21 Nov 2013 05:54:53 +0100 Subject: [PATCH] Fix eNom e-mail address parsing --- pythonwhois/parse.py | 6 +- test/data/daemonrage.net | 120 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 test/data/daemonrage.net diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index a631811..7ccef37 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -274,7 +274,7 @@ def parse_registrants(data): "Registrant ID:(?P.+)\nRegistrant Name:(?P.*)\nRegistrant Organization:(?P.*)\nRegistrant Street1:(?P.*)\nRegistrant Street2:(?P.*)\nRegistrant Street3:(?P.*)\nRegistrant City:(?P.*)\nRegistrant State/Province:(?P.*)\nRegistrant Postal Code:(?P.*)\nRegistrant Country:(?P.*)\nRegistrant Phone:(?P.*)\nRegistrant Phone Ext.:(?P.*)\nRegistrant FAX:(?P.*)\nRegistrant FAX Ext.:(?P.*)\nRegistrant Email:(?P.*)", # Public Interest Registry (.org) "Registrant ID:\s*(?P.+)\nRegistrant Name:\s*(?P.+)\nRegistrant Organization:\s*(?P.*)\nRegistrant Address1:\s*(?P.+)\nRegistrant Address2:\s*(?P.*)\nRegistrant City:\s*(?P.+)\nRegistrant State/Province:\s*(?P.+)\nRegistrant Postal Code:\s*(?P.+)\nRegistrant Country:\s*(?P.+)\nRegistrant Country Code:\s*(?P.+)\nRegistrant Phone Number:\s*(?P.+)\nRegistrant Email:\s*(?P.+)\n", # .CO Internet "Registrant Contact: (?P.+)\nRegistrant Organization: (?P.+)\nRegistrant Name: (?P.+)\nRegistrant Street: (?P.+)\nRegistrant City: (?P.+)\nRegistrant Postal Code: (?P.+)\nRegistrant State: (?P.+)\nRegistrant Country: (?P.+)\nRegistrant Phone: (?P.*)\nRegistrant Phone Ext: (?P.*)\nRegistrant Fax: (?P.*)\nRegistrant Fax Ext: (?P.*)\nRegistrant Email: (?P.*)\n", # Key-Systems GmbH - "Registrant Name: (?P.+)\nRegistrant Organization: (?P.*)\nRegistrant Street: (?P.+)\n(?:Registrant Street: (?P.+)\n)?Registrant City: (?P.+)\nRegistrant State\/Province: (?P.+)\nRegistrant Postal Code: (?P.+)\nRegistrant Country: (?P.+)\n(?:Registrant Phone: (?P.+)\n)?(?:Registrant Phone Ext: (?P.*)\n)?(?:Registrant Fax: (?P.+)\n)?(?:Registrant Fax Ext: (?P.*)\n)?(?:Registrant Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap + "Registrant Name: (?P.*)\nRegistrant Organization: (?P.*)\nRegistrant Street: (?P.+)\n(?:Registrant Street: (?P.+)\n)?Registrant City: (?P.+)\nRegistrant State\/Province: (?P.+)\nRegistrant Postal Code: (?P.+)\nRegistrant Country: (?P.+)\n(?:Registrant Phone: (?P.*)\n)?(?:Registrant Phone Ext: (?P.*)\n)?(?:Registrant Fax: (?P.*)\n)?(?:Registrant Fax Ext:\s*?(?P.*)\n)?(?:Registrant Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom "Registrant\n (?P.+)\n Email:(?P.+)\n (?P.+)\n(?: (?P.+)\n)? (?P.+) (?P.+)\n (?P.+)\n Tel: (?P.+)\n\n", # internet.bs "Holder of domain name:\n(?P[\S\s]+)\n(?P.+)\n(?P[A-Z0-9-]+)\s+(?P.+)\n(?P.+)\nContractual Language", # nic.ch "\n\n(?:Owner)?\s+: (?P.*)\n(?:\s+: (?P.*)\n)?\s+: (?P.*)\n\s+: (?P.*)\n\s+: (?P.*)\n\s+: (?P.*)\n", # nic.io @@ -287,7 +287,7 @@ def parse_registrants(data): "Tech ID:(?P.+)\nTech Name:(?P.*)\nTech Organization:(?P.*)\nTech Street1:(?P.*)\nTech Street2:(?P.*)\nTech Street3:(?P.*)\nTech City:(?P.*)\nTech State/Province:(?P.*)\nTech Postal Code:(?P.*)\nTech Country:(?P.*)\nTech Phone:(?P.*)\nTech Phone Ext.:(?P.*)\nTech FAX:(?P.*)\nTech FAX Ext.:(?P.*)\nTech Email:(?P.*)", # Public Interest Registry (.org) "Technical Contact ID:\s*(?P.+)\nTechnical Contact Name:\s*(?P.+)\nTechnical Contact Organization:\s*(?P.*)\nTechnical Contact Address1:\s*(?P.+)\nTechnical Contact Address2:\s*(?P.*)\nTechnical Contact City:\s*(?P.+)\nTechnical Contact State/Province:\s*(?P.+)\nTechnical Contact Postal Code:\s*(?P.+)\nTechnical Contact Country:\s*(?P.+)\nTechnical Contact Country Code:\s*(?P.+)\nTechnical Contact Phone Number:\s*(?P.+)\nTechnical Contact Email:\s*(?P.+)\n", # .CO Internet "Tech Contact: (?P.+)\nTech Organization: (?P.+)\nTech Name: (?P.+)\nTech Street: (?P.+)\nTech City: (?P.+)\nTech Postal Code: (?P.+)\nTech State: (?P.+)\nTech Country: (?P.+)\nTech Phone: (?P.*)\nTech Phone Ext: (?P.*)\nTech Fax: (?P.*)\nTech Fax Ext: (?P.*)\nTech Email: (?P.*)\n", # Key-Systems GmbH - "Tech Name: (?P.+)\nTech Organization: (?P.*)\nTech Street: (?P.+)\n(?:Tech Street: (?P.+)\n)?Tech City: (?P.+)\nTech State\/Province: (?P.+)\nTech Postal Code: (?P.+)\nTech Country: (?P.+)\n(?:Tech Phone: (?P.+)\n)?(?:Tech Phone Ext: (?P.*)\n)?(?:Tech Fax: (?P.+)\n)?(?:Tech Fax Ext: (?P.*)\n)?(?:Tech Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap + "Tech Name: (?P.*)\nTech Organization: (?P.*)\nTech Street: (?P.+)\n(?:Tech Street: (?P.+)\n)?Tech City: (?P.+)\nTech State\/Province: (?P.+)\nTech Postal Code: (?P.+)\nTech Country: (?P.+)\n(?:Tech Phone: (?P.*)\n)?(?:Tech Phone Ext: (?P.*)\n)?(?:Tech Fax: (?P.*)\n)?(?:Tech Fax Ext:\s*?(?P.*)\n)?(?:Tech Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom "Technical Contact\n (?P.+)\n Email:(?P.+)\n (?P.+)\n(?: (?P.+)\n)? (?P.+) (?P.+)\n (?P.+)\n Tel: (?P.+)\n\n", # internet.bs "Technical contact:\n(?P[\S\s]+)\n(?P.+)\n(?P[A-Z0-9-]+)\s+(?P.+)\n(?P.+)\n\n" # nic.ch ] @@ -297,7 +297,7 @@ def parse_registrants(data): "Admin ID:(?P.+)\nAdmin Name:(?P.*)\nAdmin Organization:(?P.*)\nAdmin Street1:(?P.*)\nAdmin Street2:(?P.*)\nAdmin Street3:(?P.*)\nAdmin City:(?P.*)\nAdmin State/Province:(?P.*)\nAdmin Postal Code:(?P.*)\nAdmin Country:(?P.*)\nAdmin Phone:(?P.*)\nAdmin Phone Ext.:(?P.*)\nAdmin FAX:(?P.*)\nAdmin FAX Ext.:(?P.*)\nAdmin Email:(?P.*)", # Public Interest Registry (.org) "Administrative Contact ID:\s*(?P.+)\nAdministrative Contact Name:\s*(?P.+)\nAdministrative Contact Organization:\s*(?P.*)\nAdministrative Contact Address1:\s*(?P.+)\nAdministrative Contact Address2:\s*(?P.*)\nAdministrative Contact City:\s*(?P.+)\nAdministrative Contact State/Province:\s*(?P.+)\nAdministrative Contact Postal Code:\s*(?P.+)\nAdministrative Contact Country:\s*(?P.+)\nAdministrative Contact Country Code:\s*(?P.+)\nAdministrative Contact Phone Number:\s*(?P.+)\nAdministrative Contact Email:\s*(?P.+)\n", # .CO Internet "Admin Contact: (?P.+)\nAdmin Organization: (?P.+)\nAdmin Name: (?P.+)\nAdmin Street: (?P.+)\nAdmin City: (?P.+)\nAdmin State: (?P.+)\nAdmin Postal Code: (?P.+)\nAdmin Country: (?P.+)\nAdmin Phone: (?P.*)\nAdmin Phone Ext: (?P.*)\nAdmin Fax: (?P.*)\nAdmin Fax Ext: (?P.*)\nAdmin Email: (?P.*)\n", # Key-Systems GmbH - "Admin Name: (?P.+)\nAdmin Organization: (?P.*)\nAdmin Street: (?P.+)\n(?:Admin Street: (?P.+)\n)?Admin City: (?P.+)\nAdmin State\/Province: (?P.+)\nAdmin Postal Code: (?P.+)\nAdmin Country: (?P.+)\n(?:Admin Phone: (?P.+)\n)?(?:Admin Phone Ext: (?P.*)\n)?(?:Admin Fax: (?P.+)\n)?(?:Admin Fax Ext: (?P.*)\n)?(?:Admin Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap + "Admin Name: (?P.*)\nAdmin Organization: (?P.*)\nAdmin Street: (?P.+)\n(?:Admin Street: (?P.+)\n)?Admin City: (?P.+)\nAdmin State\/Province: (?P.+)\nAdmin Postal Code: (?P.+)\nAdmin Country: (?P.+)\n(?:Admin Phone: (?P.*)\n)?(?:Admin Phone Ext: (?P.*)\n)?(?:Admin Fax: (?P.*)\n)?(?:Admin Fax Ext:\s*?(?P.*)\n)?(?:Admin Email: (?P.+)\n)?", # WildWestDomains, GoDaddy, Namecheap/eNom "Administrative Contact\n (?P.+)\n Email:(?P.+)\n (?P.+)\n(?: (?P.+)\n)? (?P.+) (?P.+)\n (?P.+)\n Tel: (?P.+)\n\n", # internet.bs ] diff --git a/test/data/daemonrage.net b/test/data/daemonrage.net new file mode 100644 index 0000000..0b57787 --- /dev/null +++ b/test/data/daemonrage.net @@ -0,0 +1,120 @@ + +Domain Name: DAEMONRAGE.NET +Creation Date: 2009-10-02 21:37:00Z +Registrar Registration Expiration Date: 2014-10-02 21:37:48Z +Registrar: ENOM, INC. +Reseller: NAMECHEAP.COM +Registrant Name: +Registrant Organization: WORLDFORMEE +Registrant Street: 257 MONKS ROAD +Registrant City: LINCOLN +Registrant State/Province: LINCOLNSHIRE +Registrant Postal Code: LN25JX +Registrant Country: GB +Admin Name: PAUL WEBSTER +Admin Organization: +Admin Street: WORLDFORMEE +Admin Street: 257 MONKS ROAD +Admin City: LINCOLN +Admin State/Province: LINCOLNSHIRE +Admin Postal Code: LN25JX +Admin Country: GB +Admin Phone: 01522718954 +Admin Phone Ext: +Admin Fax: +Admin Fax Ext: +Admin Email: PAUL.G.WEBSTER@GOOGLEMAIL.COM +Tech Name: PAUL WEBSTER +Tech Organization: +Tech Street: WORLDFORMEE +Tech Street: 257 MONKS ROAD +Tech City: LINCOLN +Tech State/Province: LINCOLNSHIRE +Tech Postal Code: LN25JX +Tech Country: GB +Tech Phone: 01522718954 +Tech Phone Ext: +Tech Fax: +Tech Fax Ext: +Tech Email: PAUL.G.WEBSTER@GOOGLEMAIL.COM +Name Server: NS1.HE.NET +Name Server: NS2.HE.NET +Name Server: NS3.HE.NET +Name Server: NS4.HE.NET +Name Server: NS5.HE.NET + +The data in this whois database is provided to you for information +purposes only, that is, to assist you in obtaining information about or +related to a domain name registration record. We make this information +available "as is," and do not guarantee its accuracy. By submitting a +whois query, you agree that you will use this data only for lawful +purposes and that, under no circumstances will you use this data to: (1) +enable high volume, automated, electronic processes that stress or load +this whois database system providing you this information; or (2) allow, +enable, or otherwise support the transmission of mass unsolicited, +commercial advertising or solicitations via direct mail, electronic +mail, or by telephone. The compilation, repackaging, dissemination or +other use of this data is expressly prohibited without prior written +consent from us. + +We reserve the right to modify these terms at any time. By submitting +this query, you agree to abide by these terms. +Version 6.3 4/3/2002 + +-- + +Whois Server Version 2.0 + +Domain names in the .com and .net domains can now be registered +with many different competing registrars. Go to http://www.internic.net +for detailed information. + + Domain Name: DAEMONRAGE.NET + Registrar: ENOM, INC. + Whois Server: whois.enom.com + Referral URL: http://www.enom.com + Name Server: NS1.HE.NET + Name Server: NS2.HE.NET + Name Server: NS3.HE.NET + Name Server: NS4.HE.NET + Name Server: NS5.HE.NET + Status: clientTransferProhibited + Updated Date: 18-oct-2013 + Creation Date: 02-oct-2009 + Expiration Date: 02-oct-2014 + +>>> Last update of whois database: Thu, 21 Nov 2013 04:08:18 UTC <<< + +NOTICE: The expiration date displayed in this record is the date the +registrar's sponsorship of the domain name registration in the registry is +currently set to expire. This date does not necessarily reflect the expiration +date of the domain name registrant's agreement with the sponsoring +registrar. Users may consult the sponsoring registrar's Whois database to +view the registrar's reported date of expiration for this registration. + +TERMS OF USE: You are not authorized to access or query our Whois +database through the use of electronic processes that are high-volume and +automated except as reasonably necessary to register domain names or +modify existing registrations; the Data in VeriSign Global Registry +Services' ("VeriSign") Whois database is provided by VeriSign for +information purposes only, and to assist persons in obtaining information +about or related to a domain name registration record. VeriSign does not +guarantee its accuracy. By submitting a Whois query, you agree to abide +by the following terms of use: You agree that you may use this Data only +for lawful purposes and that under no circumstances will you use this Data +to: (1) allow, enable, or otherwise support the transmission of mass +unsolicited, commercial advertising or solicitations via e-mail, telephone, +or facsimile; or (2) enable high volume, automated, electronic processes +that apply to VeriSign (or its computer systems). The compilation, +repackaging, dissemination or other use of this Data is expressly +prohibited without the prior written consent of VeriSign. You agree not to +use electronic processes that are automated and high-volume to access or +query the Whois database except as reasonably necessary to register +domain names or modify existing registrations. VeriSign reserves the right +to restrict your access to the Whois database in its sole discretion to ensure +operational stability. VeriSign may restrict or terminate your access to the +Whois database for failure to abide by these terms of use. VeriSign +reserves the right to modify these terms at any time. + +The Registry database contains ONLY .COM, .NET, .EDU domains and +Registrars.