调整顺序

This commit is contained in:
Jing Ling
2020-02-02 18:17:20 +08:00
parent e66edb9717
commit 02ab78d835
+6 -4
View File
@@ -220,12 +220,13 @@ class Module(object):
""" """
将各模块结果保存为json文件 将各模块结果保存为json文件
""" """
if not config.save_module_result:
return False
logger.log('DEBUG', f'将{self.source}模块发现的子域结果保存为json文件') logger.log('DEBUG', f'将{self.source}模块发现的子域结果保存为json文件')
if config.save_module_result: path = config.result_save_path.joinpath(self.domain, self.module)
dpath = config.result_save_path.joinpath(self.domain, self.module) path.mkdir(parents=True, exist_ok=True)
dpath.mkdir(parents=True, exist_ok=True)
name = self.source + '.json' name = self.source + '.json'
path = dpath.joinpath(name) path = path.joinpath(name)
with open(path, mode='w', encoding='utf-8', errors='ignore') as file: with open(path, mode='w', encoding='utf-8', errors='ignore') as file:
result = {'domain': self.domain, result = {'domain': self.domain,
'name': self.module, 'name': self.module,
@@ -235,6 +236,7 @@ class Module(object):
'subdomains': list(self.subdomains), 'subdomains': list(self.subdomains),
'records': self.records} 'records': self.records}
json.dump(result, file, ensure_ascii=False, indent=4) json.dump(result, file, ensure_ascii=False, indent=4)
return True
def gen_result(self): def gen_result(self):
results = list() results = list()