Skip to content

Commit

Permalink
#42 Set the VT polling interval to 60 seconds by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 21, 2017
1 parent 814d561 commit 3329888
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions analyzers/VirusTotal/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ class VirusTotalAnalyzer(Analyzer):

def __init__(self):
Analyzer.__init__(self)
self.service = self.getParam(
'config.service', None, 'Service parameter is missing')
self.virustotal_key = self.getParam(
'config.key', None, 'Missing VirusTotal API key')
self.service = self.getParam('config.service', None, 'Service parameter is missing')
self.virustotal_key = self.getParam('config.key', None, 'Missing VirusTotal API key')
self.polling_interval = self.getParam('config.polling_interval', 60)

def wait_file_report(self, id):
results = self.check_response(self.vt.get_file_report(id))
code = results.get('response_code', None)
if code == 1:
self.report(results)
else:
time.sleep(10)
time.sleep(self.polling_interval)
self.wait_file_report(id)

def wait_url_report(self, id):
Expand All @@ -35,7 +34,7 @@ def wait_url_report(self, id):
if code == 1:
self.report(results)
else:
time.sleep(60)
time.sleep(self.polling_interval)
self.wait_url_report(id)

def check_response(self, response):
Expand Down

0 comments on commit 3329888

Please sign in to comment.