(self, response)
Print details on a file
Print details on a file
Print details on a file
def print_file(self, response):
        """
        Print details on a file
        """
        if response["response_code"] != 200:
            print("Error with the request (reponse code %i)" % response["response_code"])
            sys.exit(1)
        if response["results"]["response_code"] == 0:
            print("File not found")
            sys.exit(0)
        print("[+] Detection: %i / %i" % (
                response["results"]["positives"],
                response["results"]["total"]
            )
        )
        print("[+] MD5: %s" % response["results"]["md5"])
        print("[+] SHA1: %s" % response["results"]["sha1"])
        print("[+] SHA256: %s" % response["results"]["sha256"])
        if "first_seen" in response['results']:
            print("[+] First Seen: %s" % response["results"]["first_seen"])
        if "last_seen" in response['results']:
            print("[+] Last Seen: %s" % response["results"]["last_seen"])
        print("[+] Link: %s" % response["results"]["permalink"])
def print_file ( self , response ) : if response [ "response_code" ] != 200 : print ( "Error with the request (reponse code %i)" % response [ "response_code" ] ) sys . exit ( 1 ) if response [ "results" ] [ "response_code" ] == 0 : print ( "File not found" ) sys . exit ( 0 ) print ( "[+] Detection: %i / %i" % ( response [ "results" ] [ "positives" ] , response [ "results" ] [ "total" ] ) ) print ( "[+] MD5: %s" % response [ "results" ] [ "md5" ] ) print ( "[+] SHA1: %s" % response [ "results" ] [ "sha1" ] ) print ( "[+] SHA256: %s" % response [ "results" ] [ "sha256" ] ) if "first_seen" in response [ 'results' ] : print ( "[+] First Seen: %s" % response [ "results" ] [ "first_seen" ] ) if "last_seen" in response [ 'results' ] : print ( "[+] Last Seen: %s" % response [ "results" ] [ "last_seen" ] ) print ( "[+] Link: %s" % response [ "results" ] [ "permalink" ] )