# HG changeset patch # User Richard # Date 1528467541 0 # Node ID 515531068842a896c387e2efe24ea6fc10023bab # Parent 08cfbab35d0b94b6d84a7da971cd4a6571624535# Parent 71c105a37bc147efb68bb58e1aa5f973a174a5fe Merged in Wolfeg/pywhois/support_.online (pull request #40) Support for .online TLD diff -r 08cfbab35d0b -r 515531068842 whois/parser.py --- 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)