I am new to python, I wrote simple script for uploading video from url to vk, I test this script with small files it's working, but for large files I get run out of memory, I read that using 'requests_toolbelt' it's possible to post large file, How can I add this to my script?
import vk import requests from homura import download import glob import os import json url=raw_input("Enter URL: ") download(url) file_name = glob.glob('*.mp4')[0] session = vk.Session(access_token='TOKEN') vkapi = vk.API(session,v='5.80' ) params={'name' : file_name,'privacy_view' : 'nobody', 'privacy_comment' : 'nobody'} param = vkapi.video.save(**params) upload_url = param['upload_url'] print ("Uploading ...") request = requests.post(upload_url, files={'video_file': open(file_name, "rb")}) os.remove (file_name)