def submit_file(self, file: File): # HTTP 404 Not Found self.api_subf.cookie = self.get_apikey() self.api_subf.file = {"file": file.fd()} data, _ = request(self.api_subf) data = frmt.jsonvert(data) return out.pformat(data)
def submit_file(self, file: File): self.api_subf.data = self.get_apikey() self.api_subf.file = {"file": (file.name, file.fd())} data, _ = request(self.api_subf) data = frmt.jsontree(data) # web.openurl(data["permalink"]) data = frmt.jsonvert(data) # return out.pformat(data) return data
def submit_file(self, file: File): self.api_subf.data = self.get_apikey() self.api_subf.file = {"file": (file.name, file.fd())} if file.len > 32 * 1024 * 1024: api_subfl = APISpec("GET", "https://www.virustotal.com", "/vtapi/v2/file/scan/upload_url") api_subfl.param = {**self.get_apikey()} data, _ = request(api_subfl) data = frmt.jsontree(data) self.api_subf.fulluri = data["upload_url"] self.api_subf.data = None else: self.api_subf.default() data, _ = request(self.api_subf) data = frmt.jsontree(data) # web.openurl(data["permalink"]) data = frmt.jsonvert(data) # return out.pformat(data) return data