Load Kaltura Media Entries and Captions
LlamaIndex reader that searches Kaltura media entries and captions via the eSearch API.
Why it matters
Integrate with Kaltura's eSearch API to extract media entries and their associated captions. This allows for efficient retrieval and indexing of your Kaltura content for further processing or analysis.
Outcomes
What it gets done
Connect to Kaltura using provided API credentials.
Perform searches on Kaltura entries using free text or structured parameters.
Optionally download and include entry captions and transcripts.
Load extracted Kaltura entry data into a structured format.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-kaltura | bash Overview
Kaltura eSearch Loader
The Kaltura eSearch Loader pulls Kaltura media entries, and optionally their captions, into LlamaIndex via the Kaltura eSearch API, searchable by free text, category, or a structured KalturaESearchEntryParams query. Use it when you need Kaltura media entries or captions searchable and loaded into LlamaIndex. It requires mandatory Kaltura credentials: partnerId, apiSecret, and userId.
What it does
The Kaltura eSearch Loader reads Kaltura Entries directly from Kaltura using the Kaltura eSearch API, returning a list of documents containing the entries and their captions as JSON. You can search either with a pre-built KalturaESearchEntryParams object -- a Kaltura class for defining search criteria like search phrases, operators, and objects to search, letting you find entries with specific tags, created within a specific time frame, or containing specific metadata -- or with a simple free-text query.
When to use - and when NOT to
Use it when you need Kaltura media entries, and optionally their captions or transcripts, pulled into LlamaIndex, filterable by free text, category, or a structured KalturaESearchEntryParams query. It requires mandatory Kaltura credentials -- partnerId, apiSecret, and userId -- with no defaults, so it is not usable without an existing Kaltura account and API access.
Inputs and outputs
Install with:
pip install llama-index-readers-kaltura-esearch
Configuration has three mandatory credentials with no default: partnerId (your Kaltura partner ID), apiSecret (your Kaltura API secret key, also called the Admin Secret), and userId (your Kaltura user ID). The rest have sensible defaults: ksType, the Kaltura session type, defaults to KalturaSessionType.ADMIN; ksExpiry, the session's expiry time, defaults to 86400 seconds; ksPrivileges, the session's privileges, defaults to "disableentitlement"; kalturaApiEndpoint, the API endpoint URL, defaults to https://cdnapi-ev.kaltura.com/; requestTimeout defaults to 500 seconds; and shouldLogApiCalls, which prints every Kaltura API call to the log when set to True, defaults to False and is meant only for debugging.
load_data runs the search and returns Kaltura entries as a list of dictionaries, where each dictionary represents one Kaltura media entry with string field names as keys. Its inputs: search_params (a pre-built KalturaESearchEntryParams object with pre-set search queries; if you leave it out, the other parameters below are used to construct the search query instead), search_operator_and (whether query filters combine with AND or OR), free_text (a free-text search query), category_ids (restrict results to entries found inside specific category IDs), withCaptions (whether to also download captions and transcript contents from Kaltura), and maxEntries (how many entries to pull, from 0 to Kaltura's own maximum page size of 500 entries per request).
Who it's for
Developers building LlamaIndex pipelines that need Kaltura media metadata, and optionally captions or transcripts, searchable by free text, category, or structured KalturaESearchEntryParams query criteria, with fine control over how many entries come back and how they're combined.
Source README
Kaltura eSearch Loader
pip install llama-index-readers-kaltura-esearch
This loader reads Kaltura Entries from Kaltura based on a Kaltura eSearch API call.
Search queries can be passed as a pre-defined object of KalturaESearchEntryParams, or through a simple free text query.
The result is a list of documents containing the Kaltura Entries and Captions json.
Parameters
KalturaESearchEntryParams
This is a Kaltura class used for performing search operations in Kaltura. You can use this class to define various search criteria, such as search phrases, operators, and objects to be searched.
For example, you can search for entries with specific tags, created within a specific time frame, or containing specific metadata.
Kaltura Configuration
To use the Kaltura eSearch Loader, you need to provide the following configuration credentials:
| Parameter | Description | Default Value |
|---|---|---|
| partnerId | Your Kaltura partner ID. | Mandatory (no default) |
| apiSecret | Your Kaltura API secret key (aka Admin Secret). | Mandatory (no default) |
| userId | Your Kaltura user ID. | Mandatory (no default) |
| ksType | The Kaltura session type. | KalturaSessionType.ADMIN |
| ksExpiry | The Kaltura session expiry time. | 86400 seconds |
| ksPrivileges | The Kaltura session privileges. | "disableentitlement" |
| kalturaApiEndpoint | The Kaltura API endpoint URL. | "https://cdnapi-ev.kaltura.com/" |
| requestTimeout | The request timeout duration in seconds. | 500 seconds |
| shouldLogApiCalls | If passed True, all the Kaltura API calls will also be printed to log (only use during debug). | False |
load_data
This method run the search in Kaltura and load Kaltura entries in a list of dictionaries.
Method inputs
- search_params: search parameters of type KalturaESearchEntryParams with pre-set search queries. If not provided, the other parameters will be used to construct the search query.
- search_operator_and: if True, the constructed search query will have AND operator between query filters, if False, the operator will be OR.
- free_text: if provided, will be used as the free text query of the search in Kaltura.
- category_ids: if provided, will only search for entries that are found inside these category ids.
- withCaptions: determines whether or not to also download captions/transcript contents from Kaltura.
- maxEntries: sets the maximum number of entries to pull from Kaltura, between 0 to 500 (max pageSize in Kaltura).
Method output
Each dictionary in the response represents a Kaltura media entry, where the keys are strings (field names) and the values can be of any type:
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.