| 54 | ) |
| 55 | |
| 56 | def __init__(self, config_file="", key="public", log_level=None): |
| 57 | if config_file != "": |
| 58 | self.virustotal_config_file = config_file |
| 59 | |
| 60 | self._logger = self._log() |
| 61 | if log_level is not None: |
| 62 | self._logger.setLevel(log_level) |
| 63 | |
| 64 | config = configparser.ConfigParser() |
| 65 | list = config.read(self.virustotal_config_file) |
| 66 | if len(list) == 0: |
| 67 | self._logger.error("Error: Could not find the config file") |
| 68 | exit(1) |
| 69 | |
| 70 | self._init_vt(config) |
| 71 | |
| 72 | if key == "private": |
| 73 | self.APIKEY = self.PRIVATE_APIKEY |
| 74 | else: |
| 75 | self.APIKEY = self.PUBLIC_APIKEY |
| 76 | |
| 77 | def get_domain_report(self, domain): |
| 78 | """ |