Quantcast
Channel: Kaltura - Latest posts
Viewing all articles
Browse latest Browse all 7410

Upload Videos To Kaltura Using Python

$
0
0

Hi Jess,

Thank you so much for replying. I managed to upload the video locally based on your suggestions. I am able to open/upload a file from my local machine, however when I am taking a base64 encoded string of a video, and convert it to something that Kaltura api can accept as a parameter. Below is my attempt at convering the string after my configuration is completed.

result = client.uploadToken.add(uploadToken)
uploadTokenId = result.id

binary = ‘converted string’

binary = base64.b64decode(binary)

fileData = io.BytesIO(binary)

resume = False
finalChunk = True
resumeAt = -1

result = client.uploadToken.upload(uploadTokenId, fileData, resume, finalChunk, resumeAt)
entry = KalturaMediaEntry()
entry.mediaType = KalturaMediaType.VIDEO
entry.name = “Video Player”

result = client.media.add(entry)
entryId = result.id
resource = KalturaUploadedFileTokenResource()
resource.token = uploadTokenId

result = client.media.addContent(entryId, resource)

My compiler is throwing this error
KalturaClient.Base.KalturaException: Missing parameter “fileData” (MISSING_MANDATORY_PARAMETER)


Viewing all articles
Browse latest Browse all 7410

Trending Articles