mirror of
https://github.com/adulau/DomainClassifier.git
synced 2024-12-23 00:55:58 +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]
|
||||
orig = self.__origin(ipaddr=dom[2])[1]
|
||||
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)
|
||||
orig = self.__origin(ipaddr=ip)[1]
|
||||
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