tus-py-client
tus-py-client copied to clipboard
Upload-Metadata not working
Hi,
I have been trying to send the file name and another info via the Upload-Metadata
header value. But somehow i cant see it in the uploaded video in cloudflare dashboard.
Here is the cloudflare documentation https://developers.cloudflare.com/stream/uploading-videos/upload-video-file/#supported-options-in-upload-metadata
Here is my code.
headers, cloudflare_config = self.get_headers()
headers["Tus-Resumable"] = "1.0.0"
headers["Upload-Length"] = "900000000"
headers["Content-Length"] = "0"
headers["Upload-Metadata"] = "requiresignedurls" #trying here first
token_url = BASE_URL + 'accounts/' + cloudflare_config['ACCOUNT_ID'] + '/stream'
try:
data = {
'maxDurationSeconds': 21600,
'requireSignedURLs': True
}
my_client = client.TusClient(token_url, headers=headers)
my_client.set_headers({'Upload-Metadata': 'requiresignedurls'}) #trying here again
my_client.metadata = {'requiresignedurls': True} #trying here again
I have tried to send the metadata in three places in the above code. None of them are working.
Can anyone help me on this issue please?
I haven't used Cloudflare on my own, so I cannot help you much. But from tus-py-client's point of view, this should work:
my_client.metadata = {'requiresignedurls': True} #trying here again
Please contact Cloudflare Support if you are still having this issue.
Set metadata in uploader
function
fs = open('/path/file')
uploader = my_client.uploader(file_stream=fs, chunk_size=200, metadata={'filename':'filename'})
Closing this issue due to inactivity. Feel free to leave a comment if you want to continue the discussion :)