Skip to content
This repository has been archived by the owner on Dec 16, 2017. It is now read-only.

Commit

Permalink
Merge pull request #133 from krmaxwell/i58-timeout
Browse files Browse the repository at this point in the history
Stop really slow downloads from holding everything up
  • Loading branch information
krmaxwell committed Apr 1, 2015
2 parents c396b25 + 8594c80 commit b2f27da
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 439 deletions.
7 changes: 4 additions & 3 deletions maltrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
import resource
import sys
import tempfile
from urlparse import urlparse

import feedparser
import grequests
import magic
import requests
from bs4 import BeautifulSoup
from urlparse import urlparse


class config:
Expand Down Expand Up @@ -286,7 +287,7 @@ def main():
past_urls = set()

args = setup_args(sys.argv)
cfg = config(args, 'maltrieve.cfg')
cfg = config(args[1:], 'maltrieve.cfg')

if cfg.proxy:
logging.info('Using proxy {proxy}'.format(proxy=cfg.proxy))
Expand Down Expand Up @@ -337,7 +338,7 @@ def main():
print "Downloading samples, check log for details"

malware_urls -= past_urls
reqs = [grequests.get(url, headers=headers, proxies=cfg.proxy) for url in malware_urls]
reqs = [grequests.get(url, timeout=60, headers=headers, proxies=cfg.proxy) for url in malware_urls]
for chunk in chunker(reqs, 32):
malware_downloads = grequests.map(chunk)
for each in malware_downloads:
Expand Down
69 changes: 0 additions & 69 deletions src/MultiPartForm.py

This file was deleted.

2 changes: 0 additions & 2 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
''' This file is part of maltrieve. See LICENSE for license details. '''

277 changes: 0 additions & 277 deletions src/maltrieve.py

This file was deleted.

Loading

0 comments on commit b2f27da

Please sign in to comment.