# HG changeset patch # User Richard Penman # Date 1482286945 -28800 # Node ID f3df17ee0909f18c02c6ce3022bd49ccfab2aee1 # Parent bb2f29951cbb02e8cf53d1c757c411ae468faff3# Parent 8acab8765146542851b38ef7258ee65a4301fbe3 merged diff -r bb2f29951cbb -r f3df17ee0909 whois/data/tlds.txt --- a/whois/data/tlds.txt Wed Dec 21 10:22:14 2016 +0800 +++ b/whois/data/tlds.txt Wed Dec 21 10:22:25 2016 +0800 @@ -712,6 +712,7 @@ OOO ORACLE ORANGE +OR ORG ORGANIC ORIGINS @@ -840,6 +841,7 @@ SC SCA SCB +SCH SCHAEFFLER SCHMIDT SCHOLARSHIPS diff -r bb2f29951cbb -r f3df17ee0909 whois/parser.py --- a/whois/parser.py Wed Dec 21 10:22:14 2016 +0800 +++ b/whois/parser.py Wed Dec 21 10:22:25 2016 +0800 @@ -237,6 +237,8 @@ return WhoisChLi(domain, text) elif domain.endswith('.li'): return WhoisChLi(domain, text) + elif domain.endswith('.id'): + return WhoisID(domain, text) else: return WhoisEntry(domain, text) @@ -1061,3 +1063,76 @@ raise PywhoisError(text) else: WhoisEntry.__init__(self, domain, text, self.regex) + +class WhoisID(WhoisEntry): + """Whois parser for .id domains + """ + regex = { + 'domain_id': 'Domain ID:(.+)', + 'domain_name': 'Domain Name:(.+)', + 'creation_date': 'Domain Create Date:(.+)', + 'updated_date': 'Domain Last Updated Date:(.+)', + 'expiration_date': 'Domain Expiration Date:(.+)', + 'transfer_date': 'Last Transferred Date:(.+)', + 'trademark_name': 'Trademark Name:(.+)', + 'trademark_country': 'Trademark Country:(.+)', + 'trademark_number': 'Trademark Number:(.+)', + 'trademark_application_date': 'Date Trademark Applied For:(.+)', + 'trademark_registration_date': 'Date Trademark Registered:(.+)', + 'registrar': 'Sponsoring Registrar:(.+)', + 'created_by': 'Created by:(.+)', + 'updated_by': 'Last Updated by Registrar:(.+)', + 'status': 'Domain Status:(.+)', # list of statuses + 'registrant_id': 'Registrant ID:(.+)', + 'registrant_name': 'Registrant Name:(.+)', + 'registrant_org': 'Registrant Organization:(.+)', + 'registrant_address': 'Registrant Address:(.+)', + 'registrant_address2': 'Registrant Address2:(.+)', + 'registrant_address3': 'Registrant Address3:(.+)', + 'registrant_city': 'Registrant City:(.+)', + 'registrant_state_province': 'Registrant State/Province:(.+)', + 'registrant_country': 'Registrant Country/Economy:(.+)', + 'registrant_postal_code': 'Registrant Postal Code:(.+)', + 'registrant_phone': 'Registrant Phone:(.+)', + 'registrant_phone_ext': 'Registrant Phone Ext\.:(.+)', + 'registrant_fax': 'Registrant FAX:(.+)', + 'registrant_fax_ext': 'Registrant FAX Ext\.:(.+)', + 'registrant_email': 'Registrant E-mail:(.+)', + 'admin_id': 'Admin ID:(.+)', + 'admin_name': 'Admin Name:(.+)', + 'admin_org': 'Admin Organization:(.+)', + 'admin_address': 'Admin Address:(.+)', + 'admin_address2': 'Admin Address2:(.+)', + 'admin_address3': 'Admin Address3:(.+)', + 'admin_city': 'Admin City:(.+)', + 'admin_state_province': 'Admin State/Province:(.+)', + 'admin_country': 'Admin Country/Economy:(.+)', + 'admin_postal_code': 'Admin Postal Code:(.+)', + 'admin_phone': 'Admin Phone:(.+)', + 'admin_phone_ext': 'Admin Phone Ext\.:(.+)', + 'admin_fax': 'Admin FAX:(.+)', + 'admin_fax_ext': 'Admin FAX Ext\.:(.+)', + 'admin_email': 'Admin E-mail:(.+)', + 'tech_id': 'Tech ID:(.+)', + 'tech_name': 'Tech Name:(.+)', + 'tech_org': 'Tech Organization:(.+)', + 'tech_address': 'Tech Address:(.+)', + 'tech_address2': 'Tech Address2:(.+)', + 'tech_address3': 'Tech Address3:(.+)', + 'tech_city': 'Tech City:(.+)', + 'tech_state_province': 'Tech State/Province:(.+)', + 'tech_country': 'Tech Country/Economy:(.+)', + 'tech_postal_code': 'Tech Postal Code:(.+)', + 'tech_phone': 'Tech Phone:(.+)', + 'tech_phone_ext': 'Tech Phone Ext\.:(.+)', + 'tech_fax': 'Tech FAX:(.+)', + 'tech_fax_ext': 'Tech FAX Ext\.:(.+)', + 'tech_email': 'Tech E-mail:(.+)', + 'name_servers': 'Nameservers:(.+)', # list of name servers + } + + def __init__(self, domain, text): + if 'NOT FOUND' in text: + raise PywhoisError(text) + else: + WhoisEntry.__init__(self, domain, text, self.regex) diff -r bb2f29951cbb -r f3df17ee0909 whois/whois.py --- a/whois/whois.py Wed Dec 21 10:22:14 2016 +0800 +++ b/whois/whois.py Wed Dec 21 10:22:25 2016 +0800 @@ -55,13 +55,14 @@ BNICHOST = "whois.registro.br" NORIDHOST = "whois.norid.no" IANAHOST = "whois.iana.org" + PANDIHOST = "whois.pandi.or.id" DENICHOST = "de.whois-servers.net" DEFAULT_PORT = "nicname" WHOIS_RECURSE = 0x01 WHOIS_QUICK = 0x02 - ip_whois = [LNICHOST, RNICHOST, PNICHOST, BNICHOST] + ip_whois = [LNICHOST, RNICHOST, PNICHOST, BNICHOST,PANDIHOST] def __init__(self): self.use_qnichost = False @@ -139,6 +140,9 @@ domain = domain.decode('utf-8').encode('idna').decode('utf-8') if domain.endswith("-NORID"): return NICClient.NORIDHOST + if domain.endswith("id"): + return NICClient.PANDIHOST + domain = domain.split('.') if len(domain) < 2: return None @@ -238,6 +242,9 @@ parser.add_option("-6", "--6bone", action="store_const", const=NICClient.SNICHOST, dest="whoishost", help="Lookup using host " + NICClient.SNICHOST) + parser.add_option("-n", "--ina", action="store_const", + const=NICClient.PANDIHOST, dest="whoishost", + help="Lookup using host " + NICClient.PANDIHOST) parser.add_option("-?", "--help", action="help") return parser.parse_args(argv)