# HG changeset patch # User Richard # Date 1512164216 0 # Node ID ec0994c0a2a0aa9c7b98a176e8effa230455e0e3 # Parent 369f758afd9b53ff47fe01afbebe0524d0c53862# Parent 196df98347d897c40e9e9333921d5b2b12147ad9 Merged in aseques/pywhois (pull request #26) All the failing tests fixed diff -r 196df98347d8 -r ec0994c0a2a0 whois/parser.py --- a/whois/parser.py Thu Nov 30 23:17:45 2017 +0100 +++ b/whois/parser.py Fri Dec 01 21:36:56 2017 +0000 @@ -264,6 +264,8 @@ return WhoisAi(domain, text) elif domain.endswith('.il'): return WhoisIl(domain, text) + elif domain.endswith('.in'): + return WhoisIn(domain, text) else: return WhoisEntry(domain, text) @@ -1275,3 +1277,23 @@ if attr == 'emails': value = value.replace(' AT ', '@') return super(WhoisIl, self)._preprocess(attr, value) + +class WhoisIn(WhoisEntry): + """Whois parser for .in domains + """ + regex = { + 'domain_name': 'Domain Name: *(.+)', + 'registrar': 'Registrar: *(.+)', + 'updated_date': 'Last Updated On: *(.+)', + 'creation_date': 'Created On: *(.+)', + 'expiration_date': 'Expiration Date: *(.+)', + 'name_servers': 'Name Server: *(.+)', + 'status': 'Status: *(.+)', + 'emails': EMAIL_REGEX, + } + + def __init__(self, domain, text): + if 'NOT FOUND' in text: + raise PywhoisError(text) + else: + WhoisEntry.__init__(self, domain, text, self.regex)