def __init__(self, domain, text): if 'No match.' in text: raise PywhoisError(text) else: super(NameEntry, self).__init__( domain, text, regex={ 'domain_name_id': 'Domain Name ID:\s*(.+)', 'domain_name': 'Domain Name:\s*(.+)', 'registrar_id': 'Sponsoring Registrar ID:\s*(.+)', 'registrar': 'Sponsoring Registrar:\s*(.+)', 'registrant_id': 'Registrant ID:\s*(.+)', 'admin_id': 'Admin ID:\s*(.+)', 'technical_id': 'Tech ID:\s*(.+)', 'billing_id': 'Billing ID:\s*(.+)', 'creation_date': 'Created On:\s*(.+)', 'expiration_date': 'Expires On:\s*(.+)', 'updated_date': 'Updated On:\s*(.+)', 'name_server_ids': 'Name Server ID:\s*(.+)', # list of name server ids 'name_servers': 'Name Server:\s*(.+)', # list of name servers 'status': 'Domain Status:\s*(.+)', # list of statuses })
def load(domain, text): if text.strip() == 'No whois server is known for this kind of object.': raise PywhoisError(text) if domain.endswith('.com'): return ComEntry(domain, text) elif domain.endswith('.net'): return NetEntry(domain, text) elif domain.endswith('.org'): return OrgEntry(domain, text) elif domain.endswith('.name'): return NameEntry(domain, text) elif domain.endswith('.me'): pass #return WhoisMe(domain, text) elif domain.endswith('.ru'): pass #return WhoisRu(domain, text) elif domain.endswith('.us'): pass #return WhoisUs(domain, text) elif domain.endswith('.uk'): return UkEntry(domain, text) elif domain.endswith('.fr'): return FrEntry(domain, text) elif domain.endswith('.fi'): pass #return WhoisFi(domain, text) elif domain.endswith('.jp'): pass #return WhoisJp(domain, text) elif domain.endswith('.pl'): return PlEntry(domain, text) elif domain.endswith('.es'): return EsEntry(domain, text) elif domain.endswith('.tl'): return TlEntry(domain, text) elif domain.endswith('.me'): return MeEntry(domain, text) elif domain.endswith('.biz'): return BizEntry(domain, text) elif domain.endswith('.sk'): return SkEntry(domain, text) elif domain.endswith('.sg'): return SgEntry(domain, text) elif domain.endswith('.eu'): return EuEntry(domain, text) elif domain.endswith('.tl'): return TlEntry(domain, text) elif domain.endswith('.xxx'): return XXXEntry(domain, text) elif domain.endswith('.nl'): return NlEntry(domain, text) elif domain.endswith('.info'): return InfoEntry(domain, text) else: return Entry(domain, text)
def __init__(self, domain, text): if text.strip() == 'NOT DISCLOSED!': raise PywhoisError(text) else: super(EuEntry, self).__init__( domain, text, regex={ 'registrant_name': 'Registrant:(.+)', # not available 'registrant_id': 'Registrant:(.+)', # not available 'registrant_country': 'Registrant\s+Country:\s*(.+)\n', 'registrant_country_code': 'Registrant\s+Country\s+Code:\s*(.+)\n', 'creation_date': 'created:(.+)\n', })
def __init__(self, domain, text): if 'Not found:' in text: raise PywhoisError(text) else: super(UkEntry, self).__init__(domain, text, regex={ 'registrant_id': 'Registrant\s+ID:\s*(.+)\n', 'registrant_name': 'Registrant:\n\s*(.+)', 'registrant_country': 'Registrant\s+Country:\s*(.+)\n', 'registrant_country_code': 'Registrant\s+Country\s+Code:\s*(.+)\n', 'creation_date': 'Registered on:\s*(.+)', })
def __init__(self, domain, text): if text.strip() == 'No entries found': raise PywhoisError(text) else: super(NlEntry, self).__init__(domain, text, regex={ 'registrant_id': 'holder-c:\s*(.+)\n', 'registrant_name': 'Registrant:\n\s*(.+)', 'creation_date': 'created:\s*(.+)', 'registrant_country': 'country:\s*(.+)\n', 'registrant_country_code': 'country:\s*(.+)\n', })
def __init__(self, domain, text): if text.strip() == 'NOT FOUND': raise PywhoisError(text) else: super(SgEntry, self).__init__(domain, text, regex={ 'registrant_id': 'Registrant\s+ID:\s*(.+)\n', 'registrant_name': 'Name:\s*(.+)\n', 'registrant_country': 'Registrant\s+Country:\s*(.+)\n', 'registrant_country_code': 'Registrant\s+Country:\s*(.+)\n', 'creation_date': 'Creation\s+Date:\s*(.+)\n', })
def __init__(self, domain, text): if 'No match for "' in text: raise PywhoisError(text) else: super( NetEntry, self).__init__(domain, text, regex={ 'registrant_id': 'Registrant\s+ID:\s*(.+)\n', 'registrant_name': 'Registrant\s+Name:\s*(.+)\n', 'registrant_country': 'Registrant\s+Country:\s*(.+)\n', 'registrant_country_code': 'Registrant\s+Country:\s*(.+)\n', 'creation_date': 'Creation\s+Date:\s*(.+)\n', })
def __init__(self, domain, text): if 'The domain you requested is not known in Freenoms database' in text: raise PywhoisError(text) else: WhoisEntry.__init__(self, domain, text, self.regex)