--- a/setup.py Fri Feb 16 20:12:48 2018 +0100
+++ b/setup.py Tue May 22 15:10:43 2018 +0000
@@ -1,7 +1,7 @@
import sys, os
import setuptools
-version = '0.6.8'
+version = '0.7.0'
setuptools.setup(
name='python-whois',
@@ -17,7 +17,9 @@
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Topic :: Internet :: WWW/HTTP'
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
],
keywords='whois, python',
author='Richard Penman',
--- a/whois/parser.py Fri Feb 16 20:12:48 2018 +0100
+++ b/whois/parser.py Tue May 22 15:10:43 2018 +0000
@@ -52,6 +52,7 @@
'%d/%m/%Y %H:%M:%S %Z', # 23/04/2015 12:00:07 EEST
'%d/%m/%Y %H:%M:%S.%f %Z', # 23/04/2015 12:00:07.619546 EEST
'%B %d %Y', # August 14 2017
+ '%d.%m.%Y %H:%M:%S', # 08.03.2014 10:28:24
]
@@ -276,6 +277,10 @@
return WhoisNz(domain, text)
elif domain.endswith('.space'):
return WhoisSpace(domain, text)
+ elif domain.endswith('.lu'):
+ return WhoisLu(domain, text)
+ elif domain.endswith('.cz'):
+ return WhoisCz(domain, text)
else:
return WhoisEntry(domain, text)
@@ -544,7 +549,7 @@
'domain_name': 'Domain Name:(.+)',
'creation_date': 'Creation Date:(.+)',
'updated_date': 'Updated Date:(.+)',
- 'expiration_date': 'Registry Expiry Date: :(.+)',
+ 'expiration_date': 'Registry Expiry Date: (.+)',
'registrar': 'Registrar:(.+)',
'status': 'Domain Status:(.+)', # list of statuses
'registrant_id': 'Registrant ID:(.+)',
@@ -627,6 +632,8 @@
class WhoisFr(WhoisEntry):
"""Whois parser for .fr domains
"""
+ dayfirst = True
+
regex = {
'domain_name': 'domain: *(.+)',
'registrar': 'registrar: *(.+)',
@@ -719,7 +726,7 @@
'tech_fax': r'Technical: *Name: *[^\n\r]+\s*Organisation: *[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *[^\n\r]+\s*Fax: *([^\n\r]+)',
'tech_email': r'Technical: *Name: *[^\n\r]+\s*Organisation: *[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *[^\n\r]+\s*Fax: *[^\n\r]+\s*Email: *([^\n\r]+)',
'registrar': r'Registrar: *Name: *([^\n\r]+)',
- 'name_servers': r'Name servers: *([^\n\r]+)\s*([^\n\r]*)', # list of name servers
+ 'name_servers': r'Name servers:\s*(.+)', # list of name servers
}
def __init__(self, domain, text):
@@ -840,7 +847,6 @@
'status': 'registration status: s*(.+)',
'expiration_date': 'expires at: *(.+)',
}
-
dayfirst = True
def __init__(self, domain, text):
@@ -1294,7 +1300,6 @@
'registrar': 'registrar name: *(.+)',
'referral_url': 'registrar info: *(.+)',
}
-
dayfirst = True
def __init__(self, domain, text):
@@ -1398,3 +1403,59 @@
raise PywhoisError(text)
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisLu(WhoisEntry):
+ """Whois parser for .lu domains
+ """
+ regex = {
+ 'domain_name': 'domainname: *(.+)',
+ 'creation_date': 'registered: *(.+)',
+ 'name_servers': 'nserver: *(.+)',
+ 'status': 'domaintype: *(.+)',
+ 'registrar': 'registrar-name: *(.+)',
+ 'registrant_name': 'org-name: *(.+)',
+ 'registrant_address': 'org-address: *(.+)',
+ 'registrant_postal_code': 'org-zipcode:*(.+)',
+ 'registrant_city': 'org-city: *(.+)',
+ 'registrant_country': 'org-country: *(.+)',
+ 'admin_name': 'adm-name: *(.+)',
+ 'admin_address': 'adm-address: *(.+)',
+ 'admin_postal_code': 'adm-zipcode: *(.+)',
+ 'admin_city': 'adm-city: *(.+)',
+ 'admin_country': 'adm-country: *(.+)',
+ 'admin_email': 'adm-email: *(.+)',
+ 'tech_name': 'tec-name: *(.+)',
+ 'tech_address': 'tec-address: *(.+)',
+ 'tech_postal_code': 'tec-zipcode: *(.+)',
+ 'tech_city': 'tec-city: *(.+)',
+ 'tech_country': 'tec-country: *(.+)',
+ 'tech_email': 'tec-email: *(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if 'No such domain' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisCz(WhoisEntry):
+ """Whois parser for .cz domains
+ """
+ regex = {
+ 'domain_name': 'domain: *(.+)',
+ 'registrant_name': 'registrant: *(.+)',
+ 'registrar': 'registrar: *(.+)',
+ 'creation_date': 'registered: *(.+)',
+ 'updated_date': 'changed: *(.+)',
+ 'expiration_date': 'expire: *(.+)',
+ 'name_servers': 'nserver: *(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if '% No entries found.' in text:
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)
+