1
我想要获取视频的列表,包括视频的所有详细信息(标题,描述,日期,标签...) 我可以获得几乎所有我需要的东西,但无法弄清楚如何获取上传日期。 我尝试使用getVideoRecorded()和getRecorded(),但都没有返回。使用Zend Gdata获取视频上传日期Youtube API
我似乎无法在Google上找到与此相关的任何内容,我只能找到类引用,它告诉我必须使用getVideoRecorded或getRecorded,但仅此而已。
我做错了什么?我怎样才能获得上传日期?
当前代码:
$authenticationURL= 'https://www.google.com/accounts/ClientLogin';
$httpClient =
Zend_Gdata_ClientLogin::getHttpClient(
$username = $yt_username,
$password = $yt_password,
$service = 'youtube',
$client = null,
$source = '', // a short string identifying your application
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$yt = new Zend_Gdata_YouTube($httpClient);
$feed = $yt->getUserUploads($yt_username);
foreach($feed as $item)
{
echo "<div>";
echo "<h4>title: " . $item->getVideoTitle() . "</h4>";
echo "<p>id: " . $item->getVideoId() . " | ";
echo "upload date: " . $item->getVideoRecorded() . "</p>";
echo "<p>description: " . $item->getVideoDescription() . "</p>";
echo "<p>tags: " . implode(", ", $item->getVideoTags()) . "</p>";
echo "</div>";
echo "<hr>";
}