Skip to content

Instantly share code, notes, and snippets.

@InvisibleRasta
Created April 10, 2020 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save InvisibleRasta/4bc00f0ae21362a2955cbfba7824ad50 to your computer and use it in GitHub Desktop.
Save InvisibleRasta/4bc00f0ae21362a2955cbfba7824ad50 to your computer and use it in GitHub Desktop.
Upload a file to anonfile.com
#!/usr/bin/env python3
import requests
import json
import sys
file = {'file': open(sys.argv[1], 'rb')}
r = requests.post("https://anonfile.com/api/upload", files=file)
content = r.content.decode("utf-8")
json_file = json.loads(content)
if(json_file["status"] == True):
print(json_file["data"]["file"]["url"]["short"])
else:
print("Something wrong with upload")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment