调整执行finish函数位置

This commit is contained in:
shmilylty
2019-08-10 00:48:51 +08:00
parent 98642da4f3
commit a7b189f311
52 changed files with 79 additions and 87 deletions
@@ -11,13 +11,15 @@ class ThreatBookAPI(Query):
self.addr = 'https://x.threatbook.cn/api/v1/domain/query'
self.key = config.threatbook_api_key
def query(self, domain):
def query(self):
"""
向接口查询子域并做子域匹配
"""
self.header = self.get_header()
self.proxy = self.get_proxy(self.source)
params = {'apikey': self.key, 'domain': domain, 'field': 'sub_domains'}
params = {'apikey': self.key,
'domain': self.domain,
'field': 'sub_domains'}
resp = self.post(self.addr, params)
if not resp:
return
@@ -31,11 +33,11 @@ class ThreatBookAPI(Query):
if not self.check(self.key):
return
self.begin()
self.query(self.domain)
self.query()
self.finish()
self.save_json()
self.gen_result()
self.save_db()
self.finish()
def do(domain): # 统一入口名字 方便多线程调用