Merged in Wolfeg/pywhois/support_.online (pull request #40)
authorRichard <richardbp@gmail.com>
Fri, 08 Jun 2018 14:19:01 +0000
changeset 182 515531068842
parent 180 08cfbab35d0b (current diff)
parent 181 71c105a37bc1 (diff)
child 185 ee41ee047aba
Merged in Wolfeg/pywhois/support_.online (pull request #40) Support for .online TLD
--- a/whois/parser.py	Tue May 22 15:10:43 2018 +0000
+++ b/whois/parser.py	Fri Jun 08 14:19:01 2018 +0000
@@ -281,6 +281,8 @@
             return WhoisLu(domain, text)
         elif domain.endswith('.cz'):
             return WhoisCz(domain, text)
+        elif domain.endswith('.online'):
+            return WhoisOnline(domain, text)
         else:
             return WhoisEntry(domain, text)
 
@@ -1459,3 +1461,31 @@
         else:
             WhoisEntry.__init__(self, domain, text, self.regex)
 
+
+class WhoisOnline(WhoisEntry):
+    """Whois parser for .online domains
+    """
+    regex = {
+        'domain_name':                    'Domain Name: *(.+)',
+        'domain__id':                     'Domain ID: *(.+)',
+        'whois_server':                   'Registrar WHOIS Server: *(.+)',
+        'registrar':                      'Registrar: *(.+)',
+        'registrar_id':                   'Registrar IANA ID: *(.+)',
+        'registrar_url':                  'Registrar URL: *(.+)',
+        'status':                         'Domain Status: *(.+)',
+        'registrant_email':               'Registrant Email: *(.+)',
+        'admin_email':                    'Admin Email: *(.+)',
+        'billing_email':                  'Billing Email: *(.+)',
+        'tech_email':                     'Tech Email: *(.+)',
+        'name_servers':                   'Name Server: *(.+)',
+        'creation_date':                  'Creation Date: *(.+)',
+        'expiration_date':                'Registry Expiry Date: *(.+)',
+        'updated_date':                   'Updated Date: *(.+)',
+        'dnssec':                         'DNSSEC: *([\S]+)'
+    }
+
+    def __init__(self, domain, text):
+        if 'Not found:' in text:
+            raise PywhoisError(text)
+        else:
+            WhoisEntry.__init__(self, domain, text, self.regex)