import requests
import json
import time
import socket

URL = "https://api.aditu.eus/"
API_ID = "YOUR_API_ID"
API_KEY = "YOUR_API_KEY"
FILE_ID = YOUR_FILE_ID


def delete_file_api(api_id, api_key, file_id):
	print("Deleting: %d" % file_id)
	PARAMS = {"api_id":api_id, "api_key": api_key, "file_id": file_id}
	r = requests.post(url = URL + "delete", data = PARAMS)
	if r.status_code != 200:
		print(r.content)
		print("There was an error: %d" % r.status_code)
		return None
	return r.json()



def delete_file(api_id, api_key, file_id):
	response = delete_file_api(api_id, api_key, file_id)
	if not response or response["error"]:
		return False
	else:
		return True



result = delete_file(API_ID, API_KEY, FILE_ID)
if result:
	print("File succesfully deleted")
else:
	print("There was an error")
