264 return WhoisAi(domain, text) |
264 return WhoisAi(domain, text) |
265 elif domain.endswith('.il'): |
265 elif domain.endswith('.il'): |
266 return WhoisIl(domain, text) |
266 return WhoisIl(domain, text) |
267 elif domain.endswith('.in'): |
267 elif domain.endswith('.in'): |
268 return WhoisIn(domain, text) |
268 return WhoisIn(domain, text) |
|
269 elif domain.endswith('.cat'): |
|
270 return WhoisCat(domain, text) |
269 else: |
271 else: |
270 return WhoisEntry(domain, text) |
272 return WhoisEntry(domain, text) |
271 |
273 |
272 |
274 |
273 class WhoisCom(WhoisEntry): |
275 class WhoisCom(WhoisEntry): |
1295 def __init__(self, domain, text): |
1297 def __init__(self, domain, text): |
1296 if 'NOT FOUND' in text: |
1298 if 'NOT FOUND' in text: |
1297 raise PywhoisError(text) |
1299 raise PywhoisError(text) |
1298 else: |
1300 else: |
1299 WhoisEntry.__init__(self, domain, text, self.regex) |
1301 WhoisEntry.__init__(self, domain, text, self.regex) |
|
1302 |
|
1303 class WhoisCat(WhoisEntry): |
|
1304 """Whois parser for .cat domains |
|
1305 """ |
|
1306 regex = { |
|
1307 'domain_name': 'Domain Name: *(.+)', |
|
1308 'registrar': 'Registrar: *(.+)', |
|
1309 'updated_date': 'Updated Date: *(.+)', |
|
1310 'creation_date': 'Creation Date: *(.+)', |
|
1311 'expiration_date': 'Registry Expiry Date: *(.+)', |
|
1312 'name_servers': 'Name Server: *(.+)', |
|
1313 'status': 'Domain status: *(.+)', |
|
1314 'emails': EMAIL_REGEX, |
|
1315 } |
|
1316 |
|
1317 def __init__(self, domain, text): |
|
1318 if 'NOT FOUND' in text: |
|
1319 raise PywhoisError(text) |
|
1320 else: |
|
1321 # Merge base class regex with specifics |
|
1322 self._regex.update(self.regex) |
|
1323 self.regex = self._regex |
|
1324 WhoisEntry.__init__(self, domain, text, self.regex) |