Delete entry via Python

Hi Kalturians!
I need your help or advice.
I’m writing script on Python using Kaltura API SDK.
When I try to delete entry with function client.baseentry.delete(entryId) it shows error “AttributeError: ‘KalturaClient’ object has no attribute ‘baseentry’”
Could you please provide me with right solution? Would be appreciated for any help. Thanks

Hi @Johnny98,

Below is sample code for the Python client.

from KalturaClient import *
from KalturaClient.Plugins.Core import *

config = KalturaConfiguration()
config.serviceUrl = "https://www.kaltura.com/"
client = KalturaClient(config)
ks = client.session.start(
      "YOUR_KALTURA_SECRET",
      "YOUR_USER_ID",
      KalturaSessionType.ADMIN,
      YOUR_PARTNER_ID)
client.setKs(ks)

entryId = ""

result = client.media.delete(entryId);
print(result);

Bear in mind that by default, calling client.media.delete(entryId) will only mark the entry as deleted [entry.status=3] in the DB. If you want that to trigger the deletion of all related files on disk, you will need to log into Admin Console->Publishers->Your Partner->Actions->Configure and check the “Purge files on deletion” option.

Note also that at developer.kaltura.com, you will find documentation for all the API actions, as well as code samples for all the clients we support. For instance, see https://developer.kaltura.com/api-docs/service/media/action/delete

Hi @Jess!
Thanks a lot for the reply, your solution is working for me!

You’re welcome, @Johnny98:)