Support for .cz TLD
authorTomas Zeman <tzeman@volny.cz>
Thu, 19 Apr 2018 12:57:03 +0200
changeset 174 f4ea199eecb2
parent 173 03eaf09581eb
child 175 f7797b7cb257
Support for .cz TLD
whois/parser.py
--- a/whois/parser.py	Wed Apr 11 17:17:31 2018 +0100
+++ b/whois/parser.py	Thu Apr 19 12:57:03 2018 +0200
@@ -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
 ]
 
 
@@ -278,6 +279,8 @@
             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)
 
@@ -1436,3 +1439,23 @@
         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)
+