Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed glob when called from CLI #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ def main():
import optparse
import threading
import Queue
import glob

parser = optparse.OptionParser(usage = """%prog [-k API_KEY] (scan|get) RESOURCE ...
'scan' asks virustotal to scan the file, even if a report
Expand Down Expand Up @@ -330,12 +329,7 @@ def main():
print "ERROR: unknown action"
return -1

resources = []
for argument in arguments:
for resource in glob.glob(argument):
resources.append(resource)

v = VirusTotal(API_KEY, limit_per_min = int(options.limit_per_min))
v = VirusTotal(api_key, limit_per_min = int(options.limit_per_min))

q = Queue.Queue()
def analyze(resource):
Expand All @@ -355,7 +349,7 @@ def analyze(resource):
print "VirusTotal returned a non correct response. It may be because the script does too many requests at the minute. See the parameter -l"

threads = []
for resource in resources:
for resource in arguments:
thread = threading.Thread(target = analyze, args = (resource, ))
threads.append(thread)

Expand Down