whois/parser.py
changeset 101 e804426aad35
parent 99 67b90bfc59c7
child 102 e8cb8d1367c0
equal deleted inserted replaced
100:b5699d950712 101:e804426aad35
   196             return WhoisPl(domain, text)
   196             return WhoisPl(domain, text)
   197         elif domain.endswith('.br'):
   197         elif domain.endswith('.br'):
   198             return WhoisBr(domain, text)
   198             return WhoisBr(domain, text)
   199         elif domain.endswith('.eu'):
   199         elif domain.endswith('.eu'):
   200             return WhoisEu(domain, text)
   200             return WhoisEu(domain, text)
       
   201         elif domain.endswith('.ee'):
       
   202             return WhoisEe(domain, text)
   201         elif domain.endswith('.kr'):
   203         elif domain.endswith('.kr'):
   202             return WhoisKr(domain, text)
   204             return WhoisKr(domain, text)
   203         elif domain.endswith('.pt'):
   205         elif domain.endswith('.pt'):
   204             return WhoisPt(domain, text)
   206             return WhoisPt(domain, text)
   205         elif domain.endswith('.bg'):
   207         elif domain.endswith('.bg'):
   659         'name_servers': r'Name servers: *([^\n\r]+)\s*([^\n\r]*)',  # list of name servers
   661         'name_servers': r'Name servers: *([^\n\r]+)\s*([^\n\r]*)',  # list of name servers
   660     }
   662     }
   661 
   663 
   662     def __init__(self, domain, text):
   664     def __init__(self, domain, text):
   663         if text.strip() == 'Status: AVAILABLE':
   665         if text.strip() == 'Status: AVAILABLE':
       
   666             raise PywhoisError(text)
       
   667         else:
       
   668             WhoisEntry.__init__(self, domain, text, self.regex)
       
   669 
       
   670 
       
   671 class WhoisEe(WhoisEntry):
       
   672     """Whois parser for .ee domains
       
   673     """
       
   674     regex = {
       
   675         'domain_name': r'Domain: *[\n\r]+\s*name: *([^\n\r]+)',
       
   676         'status': r'Domain: *[\n\r]+\s*name: *[^\n\r]+\sstatus: *([^\n\r]+)',
       
   677         'registered': r'Domain: *[\n\r]+\s*name: *[^\n\r]+\sstatus: *[^\n\r]+\sregistered: *([^\n\r]+)',
       
   678         'changed': r'Domain: *[\n\r]+\s*name: *[^\n\r]+\sstatus: *[^\n\r]+\sregistered: *[^\n\r]+\schanged: *([^\n\r]+)',
       
   679         'expire': r'Domain: *[\n\r]+\s*name: *[^\n\r]+\sstatus: *[^\n\r]+\sregistered: *[^\n\r]+\schanged: *[^\n\r]+\sexpire: *([^\n\r]+)',
       
   680 
       
   681         # 'tech_name': r'Technical: *Name: *([^\n\r]+)',
       
   682         # 'tech_org': r'Technical: *Name: *[^\n\r]+\s*Organisation: *([^\n\r]+)',
       
   683         # 'tech_phone': r'Technical: *Name: *[^\n\r]+\s*Organisation: *[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *([^\n\r]+)',
       
   684         # 'tech_fax': r'Technical: *Name: *[^\n\r]+\s*Organisation: *[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *[^\n\r]+\s*Fax: *([^\n\r]+)',
       
   685         # 'tech_email': r'Technical: *Name: *[^\n\r]+\s*Organisation: *[^\n\r]+\s*Language: *[^\n\r]+\s*Phone: *[^\n\r]+\s*Fax: *[^\n\r]+\s*Email: *([^\n\r]+)',
       
   686         'registrar': r'Registrar: *[\n\r]+\s*name: *([^\n\r]+)',
       
   687         'name_servers': r'nserver: *(.*)',  # list of name servers
       
   688     }
       
   689 
       
   690     def __init__(self, domain, text):
       
   691         if text.strip() == 'Domain not found':
   664             raise PywhoisError(text)
   692             raise PywhoisError(text)
   665         else:
   693         else:
   666             WhoisEntry.__init__(self, domain, text, self.regex)
   694             WhoisEntry.__init__(self, domain, text, self.regex)
   667 
   695 
   668 
   696