Berikut adalah script untuk mengubah / update :
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$authenticationURL= 'https://www.google.com/youtube/accounts/ClientLogin';
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
$username = 'youremail@mail.com',
$password = 'yourpassword',
$service = 'youtube',
$client = null,
$source = 'MazhtersSource', // untuk identifikasi aplikasi kita
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$developerKey = 'developerKey';
$applicationId = 'Test Upload Video';
$clientId = 'Test Upload Video Client';
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$videoEntry = new Zend_Gdata_YouTube_VideoEntry();
$feed = $yt->getVideoFeed('http://gdata.youtube.com/feeds/users/default/uploads');
foreach($feed as $entry)
{
if($entry->getVideoId() == $video_id)
{
$videoEntry = $entry;
$videoEntry->setVideoTitle('ini title yg baru');
$videoEntry->setVideoDescription('ini description yg baru');
$putUrl = $videoEntry->getEditLink()->getHref();
$yt->updateEntry($videoEntry, $putUrl);
break;
}break;
}
echo "Update File Video Sukses";
?>
Sedangkan untuk menghapus / delete bisa menggunakan script berikut :
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$authenticationURL= 'https://www.google.com/youtube/accounts/ClientLogin';
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
$username = 'youremail@mail.com',
$password = 'yourpassword',
$service = 'youtube',
$client = null,
$source = 'MazhtersSource', // untuk identifikasi aplikasi kita
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$authenticationURL= 'https://www.google.com/youtube/accounts/ClientLogin';
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
$username = 'youremail@mail.com',
$password = 'yourpassword',
$service = 'youtube',
$client = null,
$source = 'MazhtersSource', // untuk identifikasi aplikasi kita
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$developerKey = 'developerKey';
$applicationId = 'Test Upload Video';
$clientId = 'Test Upload Video Client';
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$applicationId = 'Test Upload Video';
$clientId = 'Test Upload Video Client';
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
$videoEntry = new Zend_Gdata_YouTube_VideoEntry();
$feed = $yt->getVideoFeed('http://gdata.youtube.com/feeds/users/default/uploads');
$videoEntryToDelete = null;
foreach($feed as $entry)
{
if ($entry->getVideoId() == $file_media)
{
$videoEntryToDelete = $entry;
$yt->delete($videoEntryToDelete);
break;
}
}
echo "Delete File Video Sukses";
?>
Script2 diatas ane berasumsi bahwa file berhasil di update atau di delete, ente-ente bisa memodifikasi dengan menambahkan pesan error apabila file gagal terupdate / terdelete.