mirror of
https://github.com/adulau/DomainClassifier.git
synced 2024-11-23 02:17: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:
|
for dom in self.validdomain:
|
||||||
if dom[1] == 'A':
|
if dom[1] == 'A':
|
||||||
ip = dom[2]
|
ip = dom[2]
|
||||||
|
try:
|
||||||
orig = self.__origin(ipaddr=dom[2])[1]
|
orig = self.__origin(ipaddr=dom[2])[1]
|
||||||
|
except:
|
||||||
|
continue
|
||||||
if(orig == cc): self.localdom.append(dom)
|
if(orig == cc): self.localdom.append(dom)
|
||||||
elif dom[1] == 'CNAME':
|
elif dom[1] == 'CNAME':
|
||||||
cname = str(dom[2])
|
cname = str(dom[2])
|
||||||
ip = socket.gethostbyname(cname)
|
ip = socket.gethostbyname(cname)
|
||||||
|
try:
|
||||||
orig = self.__origin(ipaddr=ip)[1]
|
orig = self.__origin(ipaddr=ip)[1]
|
||||||
|
except:
|
||||||
|
continue
|
||||||
if(orig == cc): self.localdom.append(dom)
|
if(orig == cc): self.localdom.append(dom)
|
||||||
return self.localdom
|
return self.localdom
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue