TOR module

class TOR.TOR(config: Config)

Bases: object

Class used for checking content from TOR IP feeds

get_list(name: str)

Returns response from search method :param name: name of the searched object :return: response from search :rtype: dict or bool

static is_security_flagged(response: dict) bool
static read(ip: str, key: str, log: Log, config: Config, cache: Cache)

Returns response from URL and writes to cache

Parameters:
  • ip – ip of the searched ip

  • key – key to use when writing to cache

  • log – Log object

  • config – Config object

  • cache – Cache object

Returns:

response from url

Return type:

dict | None

search(value, url_response: Response)

Returns True if value is in TOR list

Parameters:
  • value – value of the searched object

  • url_response – response from TOR

Returns:

True or False

Return type:

bool