Rename video tags on the fly

Hi,
I use a Zoom / Kaltura integration that applies the Zoom uploaders email address as a tag to the videos they upload and places the video in the category “Zoom Recordings”.
I need to be able to strip away "@myemail.com" from the tag to leave jdoe as the tag for any videos in the “Zoom Recordings” category? As I may need to do this for 100s of videos I need something that does this in bulk/automaticaly and not 1 by 1 manually.
Can anyone suggest a solution or a file I can run to do it. newbie…starting out with the Kaltura API but eager to learn. I suspect a string replace would suffice. Screenshot to assist: https://ibb.co/iT7Lox
Thanks very much!

Hi @hcanning2014,

You can update the entry’s name, description, category association and tags by making a baseEntry->update() request, see: https://developer.kaltura.com/api-docs/Enrich_and_Organize_Metadata/baseEntry/baseEntry_update

You cannot update the creatorId attribute as it is an “insert only” member/attribute.

In order to update multiple entries, you’d have to first call baseEntry->list() [see https://developer.kaltura.com/api-docs/Enrich_and_Organize_Metadata/baseEntry/baseEntry_list], to which you may pass a KalturaBaseEntryFilter object to only obtain entries matching certain criteria, then iterate over each entry and call baseEntry->update(), passing along the entry ID and a KalturaBaseEntry object with the modified values.

An example of how to iterate over Kaltura objects can be seen here:

This example uses the PHP API client but of course, the same logic can be applied with any of the other clients.

Thanks Jess…I will give it a go. My brain hurts already lol

So this seems to work for me. Not sure how resource intensive it is to execute but for 4 videos it executes in 2.8 seconds. Anyone see issues with larger volumes say 100 string replaces on 100 videos per execution? Thanks

<?php

  require_once('lib/KalturaClient.php');



  $config = new KalturaConfiguration(**partnerID**);

  $config->serviceUrl = 'https://www.kaltura.com';

  $client = new KalturaClient($config);

  $ks = $client->session->start(

    "**admin-scecret**",

    "**user-id**",

    KalturaSessionType::ADMIN,

    **partnerID**);

  $client->setKS($ks);



  $filter = new KalturaBaseEntryFilter();

  $filter->categoriesMatchAnd = "Zoom Recordings";

  $pager = new KalturaFilterPager();

  $baseEntry = new KalturaBaseEntry();

  try {

    $result = $client->baseEntry->listAction($filter, $pager);

    foreach ($result->objects as $entry) {

  $entryId = $entry->id;
  $result = str_replace("@gmail.com","","$entry->tags");
  $baseEntry->tags = $result;
  $result = $client->baseEntry->update($entryId, $baseEntry); 

                    }

      } catch (Exception $e)

     {

    echo $e->getMessage(); 

   }

   
?>