mirror of
https://github.com/adulau/DomainClassifier.git
synced 2024-11-23 02:17:07 +00:00
__origin now returns (ASN,CC)
This commit is contained in:
parent
ed9a25d1b7
commit
b46192f235
1 changed files with 4 additions and 3 deletions
|
@ -40,7 +40,8 @@ class Extract:
|
||||||
a = self.presolver.query(clook, 'TXT')
|
a = self.presolver.query(clook, 'TXT')
|
||||||
if a:
|
if a:
|
||||||
x = str(a[0]).split("|")
|
x = str(a[0]).split("|")
|
||||||
return x[2].strip()
|
x = map (lambda t: t.strip(), x)
|
||||||
|
return (x[0],x[2])
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -94,12 +95,12 @@ 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]
|
||||||
orig = self.__origin(ipaddr=dom[2])
|
orig = self.__origin(ipaddr=dom[2])[1]
|
||||||
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)
|
||||||
orig = self.__origin(ipaddr=ip)
|
orig = self.__origin(ipaddr=ip)[1]
|
||||||
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