Last active
May 14, 2021 09:00
-
-
Save imhemish/8b7f4a6018729b819f550319e841bbe0 to your computer and use it in GitHub Desktop.
gofile
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
# Upload files to gofile using their api | |
import requests | |
import json | |
import sys | |
filename = (sys.argv)[1] # You need to pass the path of file as arguement | |
getserver = "https://apiv2.gofile.io/getServer" | |
temp = requests.get(getserver) | |
myfiles = {'file': open(filename ,'rb')} | |
server = (json.loads(temp.text))["data"]["server"] | |
url = "https://"+server+".gofile.io/uploadFile" | |
data = {"email": "--your email here--"} # Add your email here | |
postrequest = requests.post(url, files = myfiles, data=data) | |
jsonloadedresponse = json.loads(postrequest.text) | |
print(jsonloadedresponse) |
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
# Upload files to gofile with gui (file select dialog) using their api | |
import requests | |
import json | |
from tkinter import Tk | |
from tkinter.filedialog import askopenfilename | |
Tk().withdraw() | |
filename = askopenfilename() | |
getserver = "https://apiv2.gofile.io/getServer" | |
temp = requests.get(getserver) | |
myfiles = {'file': open(filename ,'rb')} | |
server = (json.loads(temp.text))["data"]["server"] | |
url = "https://"+server+".gofile.io/uploadFile" | |
data = {"email": "--your email here--"} # Upload files to gofile using their api | |
postrequest = requests.post(url, files = myfiles, data=data) | |
jsonloadedresponse = json.loads(postrequest.text) | |
print(jsonloadedresponse) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment