def __init__(self, api_key, cache_file_name=None): auth_header = {'Authorization': 'Bearer {0}'.format(api_key)} self._requests = MultiRequest(default_headers=auth_header, max_requests=12, rate_limit=30) # Create an ApiCache if instructed to self._cache = ApiCache(cache_file_name) if cache_file_name else None
def __init__(self, api_key, cache_file_name=None): """Establishes basic HTTP params and loads a cache. Args: api_key: VirusTotal API key cache_file_name: String file name of cache. """ self._api_key = api_key self._requests = MultiRequest() # Create an ApiCache if instructed to self._cache = ApiCache(cache_file_name) if cache_file_name else None
def __init__(self, cache_file_name=None): """Establishes basic HTTP params and loads a cache. Args: cache_file_name: String file name of cache. """ # TODO - lookup request rate limit # By observation, ShadowServer can be quite slow, so give it 90 seconds before it times out. self._requests = MultiRequest(max_requests=2, req_timeout=90.0) # Create an ApiCache if instructed to self._cache = ApiCache(cache_file_name) if cache_file_name else None