我使用YouTube视频上传应用程序接口将视频从我的网站上传到YouTube,但是我还需要检索视频描述,并提供其url。我用了这句话
<?php $entry= getVideoEntry("kNUBV9trDoA"); echo $entry->getVideoDescription();?>
我曾经要求zend loader像这样操作这些行
include("Zend/Loader.php");但是当我这样做并在服务器上运行PHP文件时,我得到了这个错误
Fatal error: Call to undefined function getVideoEntry()我相信加载器文件会加载操作所需的所有文件
但在operation.php中也有这些行
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_App_Exception');但是,当我在loader include line下使用这些行时,我得到了这个错误
警告: include_once(Zend\Gdata\YouTube.php)函数。in once:无法打开流:没有这样的文件或目录
它们都在那个文件夹中,但是php脚本无法加载它们,路径都是正确的,我已经检查过了。
如何使用此接口检索YouTube视频的视频描述?需要什么文件?如何初始化?通过提供YouTube的URL或视频id,是否有更简单的方法来检索视频描述?
问候
发布于 2012-05-22 18:01:52
您没有正确获取视频条目。它应该是:
// Assuming $yt is an authorised Zend_Gdata_YouTube object.
$entry = $yt->getVideoEntry($videoid);
// Sometimes you may need to get the full entry:
$fullentry = $yt->getFullVideoEntry($videoid);
// Now you can get the description
$description = $entry->getVideoDescription();请阅读文档的Retrieving。
https://stackoverflow.com/questions/10681162
复制相似问题