Skip to content

Commit

Permalink
Merge pull request #3 from Keisial/master
Browse files Browse the repository at this point in the history
Support the "Registrar WHOIS Server" key name for the referral
  • Loading branch information
vavarachen authored Oct 10, 2020
2 parents 1492ffd + bc8c032 commit 135d11c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pythonwhois/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=Fals
new_list = [response] + previous
server_list.append(target_server)
for line in [x.strip() for x in response.splitlines()]:
match = re.match("(refer|whois server|referral url|whois server|registrar whois):\s*([^\s]+\.[^\s]+)", line, re.IGNORECASE)
match = re.match("(refer|whois server|referral url|registrar whois(?: server)?):\s*([^\s]+\.[^\s]+)", line, re.IGNORECASE)
if match is not None:
referal_server = match.group(2)
if referal_server != server and "://" not in referal_server: # We want to ignore anything non-WHOIS (eg. HTTP) for now.
Expand Down
3 changes: 2 additions & 1 deletion pythonwhois/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def precompile_regexes(source, flags=0):
'Domain Registrar :\s?(?P<val>.+)',
'Registration Service Provider: (?P<val>.+)',
'\tName:\t\s(?P<val>.+)'],
'whois_server': ['Whois Server:\s?(?P<val>.+)',
'whois_server': ['Registrar WHOIS Server:\s?(?P<val>.+)',
'Whois Server:\s?(?P<val>.+)',
'Registrar Whois:\s?(?P<val>.+)'],
'nameservers': ['Name Server:[ ]*(?P<val>[^ ]+)',
'Nameservers:[ ]*(?P<val>[^ ]+)',
Expand Down

0 comments on commit 135d11c

Please sign in to comment.