Created
April 10, 2020 21:14
-
-
Save InvisibleRasta/4bc00f0ae21362a2955cbfba7824ad50 to your computer and use it in GitHub Desktop.
Upload a file to anonfile.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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