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

Delete entry via Python

$
0
0

Hi @Jess!
Thanks a lot for the reply, your solution is working for me!
BTW, maybe you know if it is possible to delete the entry by name?
Now I search the file by name with 1 script, if the name is on the list, I copy it’s id and deleting it with another. I just want to simplify it and handle with only 1 script.
There is a part of my script:
def getentries():
startsession()
# Get list
filter = KalturaBaseEntryFilter()
filter.orderBy = “+createdAt” # Oldest first
pager = KalturaFilterPager()
pager.pageSize = 500
pager.pageIndex = 1

entrylist = client.media.list(filter, pager)
totalcount = entrylist.totalCount

# Loop
nid = 1
while nid < totalcount :
    entrylist = client.media.list(filter, pager)
    for entry in entrylist.objects:
		if "test" in entry.name:
			print "%i; %i; '%s'; '%s';" % (nid, entry.createdAt, entry.id, entry.name)		
		nid = nid + 1
    pager.pageIndex = pager.pageIndex + 1

getentries()

def deleteentry():
startsession()
entryId = “id for test entry”
result = client.media.delete(entryId)
print “Entry was deleted successfully”
deleteentry()


Viewing all articles
Browse latest Browse all 7410

Trending Articles