tus-py-client icon indicating copy to clipboard operation
tus-py-client copied to clipboard

Upload-Metadata not working

Open duraiganesh0 opened this issue 2 years ago • 2 comments

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?

duraiganesh0 avatar Mar 23 '22 18:03 duraiganesh0

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.

Acconut avatar Jun 17 '22 14:06 Acconut

Set metadata in uploader function

fs = open('/path/file')
uploader = my_client.uploader(file_stream=fs, chunk_size=200, metadata={'filename':'filename'})

sharif779 avatar Oct 13 '22 09:10 sharif779

Closing this issue due to inactivity. Feel free to leave a comment if you want to continue the discussion :)

Acconut avatar Feb 11 '23 20:02 Acconut