Skip to content

Commit

Permalink
fix FofaApi超时问题
Browse files Browse the repository at this point in the history
  • Loading branch information
nosafer committed Jan 6, 2021
1 parent e315159 commit f61d958
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mod/fofa.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,18 @@ def run(self):
datas = json.loads(target.text)
self.ipInfo(datas['results'])
req.close()
lock.release()
except requests.exceptions.ReadTimeout:
print(mkPut.fuchsia('[{0}]'.format(time.strftime(
"%H:%M:%S", time.localtime()))), mkPut.red('[ERROR]'), '请求超时')
except requests.exceptions.ConnectionError:
print(mkPut.fuchsia('[{0}]'.format(time.strftime(
"%H:%M:%S", time.localtime()))), mkPut.red('[ERROR]'), '请求超时')
"%H:%M:%S", time.localtime()))), mkPut.red('[ERROR]'), '网络超时')
except json.decoder.JSONDecodeError:
print(mkPut.fuchsia('[{0}]'.format(time.strftime(
"%H:%M:%S", time.localtime()))), mkPut.red('[ERROR]'), '获取失败,请重试')
lock.release()
self.sem.release()
lock.release()

def ipInfo(self, datas):
print(mkPut.fuchsia('[{0}]'.format(time.strftime(
Expand Down

0 comments on commit f61d958

Please sign in to comment.