Reputation: 406
So I have successfully created an upload script using the API, but now I am having troubles with an update/delete script. It appears there is a broken link on the Gdata website which originally lead to a page of the Zend_Gdata_YouTube_VideoEntry object, and I need to figure out how to give the API which video to delete/update.
I have the video ID of the video I want to update, but I can't seem to find where to put it in my update request.
My code for updating only consists of the sample code as provided on the Gdata website, and so here is the website: http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Updating_Video_Information
I am after how to specify which video to update, similar to a WHERE statement in a SQL query. Does anybody know how to do this?
Please leave a comment if more information is required. Thanks!
Upvotes: 0
Views: 727
Reputation: 12786
You need to get the video entry for a video and then use that to update it.
http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Retrieving_Video_Entry
so your update code should be as followed:
$videoEntry = $yt->getVideoEntry('the0KZLEacs');
$putUrl = $videoEntry->getEditLink()->getHref();
$videoEntry->setVideoDescription('This description is better. Hurrah!');
$yt->updateEntry($videoEntry, $putUrl);
Untested but it should do the trick. I just combined 2 examples from the link you provided.
Upvotes: 1