Python病毒云扫描
import virustotal_pythonimport os.path
from pprint import pprint
FILE_PATH = "/path/to/file/to/scan.txt"
# Create dictionary containing the file to send for multipart encoding upload
files = {"file": (os.path.basename(FILE_PATH), open(os.path.abspath(FILE_PATH), "rb"))}
with virustotal_python.Virustotal("<VirusTotal API Key>") as vtotal:
resp = vtotal.request("files", files=files, method="POST")
pprint(resp.json())
页:
[1]