mirror of
https://github.com/adulau/DomainClassifier.git
synced 2024-11-22 18:07:07 +00:00
Exception handled for unknown origins
This commit is contained in:
parent
94482dcfbf
commit
d116cfc37b
1 changed files with 8 additions and 2 deletions
|
@ -146,12 +146,18 @@ class Extract:
|
|||
for dom in self.validdomain:
|
||||
if dom[1] == 'A':
|
||||
ip = dom[2]
|
||||
try:
|
||||
orig = self.__origin(ipaddr=dom[2])[1]
|
||||
except:
|
||||
continue
|
||||
if(orig == cc): self.localdom.append(dom)
|
||||
elif dom[1] == 'CNAME':
|
||||
cname = str(dom[2])
|
||||
ip = socket.gethostbyname(cname)
|
||||
try:
|
||||
orig = self.__origin(ipaddr=ip)[1]
|
||||
except:
|
||||
continue
|
||||
if(orig == cc): self.localdom.append(dom)
|
||||
return self.localdom
|
||||
|
||||
|
|
Loading…
Reference in a new issue