mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [Domain] is_domain_up
This commit is contained in:
parent
fb6324d4e6
commit
dee5e8490f
1 changed files with 11 additions and 2 deletions
|
@ -148,8 +148,17 @@ def sanathyse_port(port, domain, domain_type, strict=False, current_port=None):
|
|||
port = get_random_domain_port(domain, domain_type)
|
||||
return port
|
||||
|
||||
def is_domain_up(domain, domain_type):
|
||||
return r_serv_onion.hexists('{}_metadata:{}'.format(domain_type, domain), 'ports')
|
||||
def is_domain_up(domain, domain_type, ports=[]):
|
||||
if not ports:
|
||||
ports = get_domain_all_ports(domain, domain_type)
|
||||
for port in ports:
|
||||
res = r_serv_onion.zrevrange('crawler_history_{}:{}:{}'.format(domain_type, domain, port), 0, 0, withscores=True)
|
||||
if res:
|
||||
item_core, epoch = res[0]
|
||||
epoch = int(epoch)
|
||||
if item_core != str(epoch):
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_domain_first_up(domain, domain_type, ports=None):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue