mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-10-25 00:56:14 +08:00
优化无解析结果处理
This commit is contained in:
@@ -361,9 +361,6 @@ def deal_output(output_path, ip_times, wildcard_ips, wildcard_ttl):
|
|||||||
records, subdomains = gen_records(items, records, subdomains,
|
records, subdomains = gen_records(items, records, subdomains,
|
||||||
ip_times, wildcard_ips,
|
ip_times, wildcard_ips,
|
||||||
wildcard_ttl)
|
wildcard_ttl)
|
||||||
if not records:
|
|
||||||
logger.log('FATAL', f'无有效解析结果')
|
|
||||||
exit(1)
|
|
||||||
return records, subdomains
|
return records, subdomains
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ class Module(object):
|
|||||||
"""
|
"""
|
||||||
logger.log('DEBUG', f'正在生成最终结果')
|
logger.log('DEBUG', f'正在生成最终结果')
|
||||||
if not len(self.subdomains): # 该模块一个子域都没有发现的情况
|
if not len(self.subdomains): # 该模块一个子域都没有发现的情况
|
||||||
|
logger.log('DEBUG', f'{self.source}模块收集结果为空')
|
||||||
result = {'id': None,
|
result = {'id': None,
|
||||||
'type': self.type,
|
'type': self.type,
|
||||||
'alive': None,
|
'alive': None,
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ def update_data(data, records):
|
|||||||
:return: 更新后的数据列表
|
:return: 更新后的数据列表
|
||||||
"""
|
"""
|
||||||
logger.log('DEBUG', f'正在更新解析结果')
|
logger.log('DEBUG', f'正在更新解析结果')
|
||||||
|
if not records:
|
||||||
|
logger.log('ERROR', f'无有效解析结果')
|
||||||
|
return data
|
||||||
for index, items in enumerate(data):
|
for index, items in enumerate(data):
|
||||||
if not items.get('content'):
|
if not items.get('content'):
|
||||||
subdomain = items.get('subdomain')
|
subdomain = items.get('subdomain')
|
||||||
@@ -121,9 +124,6 @@ def deal_output(output_path):
|
|||||||
record['resolve'] = 0
|
record['resolve'] = 0
|
||||||
record['reason'] = 'NOARECORD'
|
record['reason'] = 'NOARECORD'
|
||||||
records[qname] = record
|
records[qname] = record
|
||||||
if not records:
|
|
||||||
logger.log('FATAL', f'无有效解析结果')
|
|
||||||
exit(1)
|
|
||||||
return records
|
return records
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user