Esempio n. 1
0
 def upload_tus(cls, path, name=None, parent_id=0):
     headers = {'Authorization': 'token %s' % cls.client.access_token}
     metadata = {'parent_id': str(parent_id)}
     if name:
         metadata['name'] = name
     with open(path) as f:
         tus.upload(f, TUS_UPLOAD_URL, file_name=name, headers=headers, metadata=metadata)
Esempio n. 2
0
 def upload_tus(cls, path, name=None, parent_id=0):
     headers = {'Authorization': 'token %s' % cls.client.access_token}
     metadata = {'parent_id': str(parent_id)}
     if name:
         metadata['name'] = name
     with open(path) as f:
         tus.upload(f, TUS_UPLOAD_URL, file_name=name, headers=headers, metadata=metadata)
Esempio n. 3
0
 def upload_tus(cls, path, name=None, parent_id=0):
     headers = {"Authorization": "token %s" % cls.client.access_token}
     metadata = {"parent_id": str(parent_id)}
     if name:
         metadata["name"] = name
     with open(path) as f:
         tus.upload(f, TUS_UPLOAD_URL, file_name=name, headers=headers, metadata=metadata)
Esempio n. 4
0
 def upload(self, filename):
     """
     Upload videos to Vectorly
     :param filename: File name
     :return:
     """
     url = 'https://tus.vectorly.io/files/'
     with open(filename, 'rb') as f:
         tus.upload(f, url, chunk_size=self.chunk_size, metadata={'api_key': self.api_key})
     pass
Esempio n. 5
0
import tus

FILE_PATH = 'tes5.mp4'
TUS_ENDPOINT = 'https://upload299.fvs.io/upload/'
HEADERS = {
    'Upload-Metadata':
    'token  blhUUUNYais4L1UrVllyZVluYnRhNktFYmF5Mnd0V1NyZVd4T2JKbk5mZGNTTHdPUi9HOXAyMzZjT1RUWG9lNW56MEQzTTJYTDBVVWxlYXh3QT09OmdkWG1WMzFuMTVGOHNFNmNKOXFQVFE9P, name dGVzNS5tcDQ='
}
CHUNK_SIZE = 256000

with open(FILE_PATH, 'rb') as f:
    tus.upload(f, TUS_ENDPOINT, headers=HEADERS, chunk_size=CHUNK_SIZE)