# HG changeset patch # User Peter Gonda # Date 1483632887 -3600 # Node ID 32947b10adce71a009f1a6fec732b46355b64e8e # Parent fff9472eb92089dbf308c3a1904b5d7f897bcf04 Add Slovak TLD (.sk) domain support diff -r fff9472eb920 -r 32947b10adce whois/parser.py --- a/whois/parser.py Wed Dec 21 12:20:21 2016 +0800 +++ b/whois/parser.py Thu Jan 05 17:14:47 2017 +0100 @@ -239,6 +239,8 @@ return WhoisChLi(domain, text) elif domain.endswith('.id'): return WhoisID(domain, text) + elif domain.endswith('.sk'): + return WhoisSK(domain, text) else: return WhoisEntry(domain, text) @@ -1064,6 +1066,7 @@ else: WhoisEntry.__init__(self, domain, text, self.regex) + class WhoisID(WhoisEntry): """Whois parser for .id domains """ @@ -1094,3 +1097,36 @@ raise PywhoisError(text) else: WhoisEntry.__init__(self, domain, text, self.regex) + + +class WhoisSK(WhoisEntry): + """ + Whois parser for .sk domains + """ + regex = { + 'domain_name': 'Domain-name *(.+)', + 'expiration_date': 'Valid-date *(.+)', + 'status': 'Domain-status *(.+)', + 'name_servers': 'dns_name *(.+)', + 'tech_id': 'Tech-id *(.+)', + 'tech_name': 'Tech-name *(.+)', + 'tech_org_id': 'Tech-org.-ID *(.+)', + 'tech_address': 'Tech-address *(.+)', + 'tech_email': 'Tech-email *(.+)', + 'admin_id': 'Admin-id *(.+)', + 'admin_name': 'Admin-name *(.+)', + 'admin_legal_form': 'Admin-legal-form (.+)', + 'admin_org_id': 'Admin-org.-ID *(.+)', + 'admin_address': 'Admin-address *(.+)', + 'admin_email': 'Admin-email *(.+)', + 'updated_date': 'Last-update *(.+)', + 'tech_phone': 'Tech-telephone *(.+)', + 'name_servers_ipv4': 'dns_IPv4 *(.+)', + + } + + def __init__(self, domain, text): + if 'NOT FOUND' in text: + raise PywhoisError(text) + else: + WhoisEntry.__init__(self, domain, text, self.regex)