I need to upload large (2-20 GB) videos to a streaming service without loading them into the ram.The code i wrote is working but i don't have the resources to handle large files. Is there a way in python to that?
def upload(file):
files = {'file1': open(file, 'rb',0)}
r = requests.post(url,files=files)
data = r.json()
print(data["msg"])
return data["result"]["id"]
Their API says i have to POST the file and it shall be multipart/form-data encoded
Example with curl:
curl -F file1=@/path/to/file.txt https://www.example.com/uls/jAZUhVzeU78