add rate limit
This commit is contained in:
@@ -32,6 +32,7 @@ parser.add_argument('-i', help='Import target URLs from file.', dest='import_fil
|
||||
parser.add_argument('-T', help='HTTP request timeout in seconds. (default: 15)', dest='timeout', type=float, default=15)
|
||||
parser.add_argument('-c', help='Chunk size. The number of parameters to be sent at once', type=int, dest='chunks', default=250)
|
||||
parser.add_argument('-q', help='Quiet mode. No output.', dest='quiet', action='store_true')
|
||||
parser.add_argument('--rate-limit', help='Max number of requests to be sent out per second (default: 9999)', dest='rate_limit', type=int, default=9999)
|
||||
parser.add_argument('--headers', help='Add headers. Separate multiple headers with a new line.', dest='headers', nargs='?', const=True)
|
||||
parser.add_argument('--passive', help='Collect parameter names from passive sources like wayback, commoncrawl and otx.', dest='passive', nargs='?', const='-')
|
||||
parser.add_argument('--stable', help='Prefer stability over speed.', dest='stable', action='store_true')
|
||||
|
||||
@@ -6,10 +6,13 @@ import warnings
|
||||
|
||||
import arjun.core.config as mem
|
||||
|
||||
from ratelimit import limits, sleep_and_retry
|
||||
from arjun.core.utils import dict_to_xml
|
||||
|
||||
warnings.filterwarnings('ignore') # Disable SSL related warnings
|
||||
|
||||
@sleep_and_retry
|
||||
@limits(calls=mem.var['rate_limit'], period=1)
|
||||
def requester(request, payload={}):
|
||||
"""
|
||||
central function for making http requests
|
||||
|
||||
Reference in New Issue
Block a user