mirror of https://github.com/CIRCL/lookyloo
Merge pull request #201 from FafnerKeyZee/patch-4
solving tor proxy for only_global_lookupspull/203/head
commit
318cc7cf9c
|
@ -777,13 +777,14 @@ class Lookyloo():
|
||||||
splitted_url = urlsplit(url)
|
splitted_url = urlsplit(url)
|
||||||
if splitted_url.netloc:
|
if splitted_url.netloc:
|
||||||
if splitted_url.hostname:
|
if splitted_url.hostname:
|
||||||
try:
|
if splitted_url.hostname.split('.')[-1] != 'onion':
|
||||||
ip = socket.gethostbyname(splitted_url.hostname)
|
try:
|
||||||
except socket.gaierror:
|
ip = socket.gethostbyname(splitted_url.hostname)
|
||||||
self.logger.info('Name or service not known')
|
except socket.gaierror:
|
||||||
return False
|
self.logger.info('Name or service not known')
|
||||||
if not ipaddress.ip_address(ip).is_global:
|
return False
|
||||||
return False
|
if not ipaddress.ip_address(ip).is_global:
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue