check_deletion.py 718 B

1234567891011121314151617181920
  1. #!/usr/bin/env python3
  2. import os
  3. import sys
  4. import json
  5. result = json.loads(open("deletion.json").read())
  6. if result["result"] == "success":
  7. print("[-] \""+str(sys.argv[1])+"\" deleted from Neocities.")
  8. os.system("touch delresult.ok")
  9. elif result["result"] == "error" and result["message"].count("was not found on your site, canceled deleting")>0:
  10. print("[!] \""+str(sys.argv[1])+"\" already deleted or file doesn't exist.")
  11. os.system("touch delresult.err")
  12. elif result["result"] == "error":
  13. print("[!] \""+str(sys.argv[1])+"\" deletion failed. Response: \""+result["message"]+"\"")
  14. os.system("touch delresult.err")
  15. else:
  16. print("[!] File deleted?... (parsing/response error)")
  17. os.system("rm -f deletion.json")