-
Notifications
You must be signed in to change notification settings - Fork 1
/
getCaptionedEntriesEsearch.py
35 lines (30 loc) · 1.23 KB
/
getCaptionedEntriesEsearch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from KalturaClient import *
from KalturaClient.Plugins.Core import *
from KalturaClient.Plugins.ElasticSearch import *
# Fill in the below three values appropriately
PARTNER_ID = "xxxxxx"
ADMIN_SECRET = "yyyyyy"
USER_ID = "zzzzzz"
config = KalturaConfiguration(PARTNER_ID)
config.serviceUrl = "https://www.kaltura.com/"
client = KalturaClient(config)
ks = client.generateSessionV2(
ADMIN_SECRET,
USER_ID,
KalturaSessionType.ADMIN,
PARTNER_ID,
86400,
"disableentitlement")
client.setKs(ks)
search_params = KalturaESearchEntryParams()
search_params.searchOperator = KalturaESearchEntryOperator()
search_params.searchOperator.operator = KalturaESearchOperatorType.AND_OP
search_params.searchOperator.searchItems = []
search_params.searchOperator.searchItems.append(KalturaESearchEntryItem())
search_params.searchOperator.searchItems[0].itemType = KalturaESearchItemType.EXISTS
search_params.searchOperator.searchItems[0].fieldName = KalturaESearchEntryFieldName.CAPTIONS_CONTENT
pager = KalturaPager()
result = client.elasticSearch.eSearch.searchEntry(search_params, pager)
print("---------------------\nEntries with captions:\n---------------------")
for entry in result.objects:
print(entry.object.id)