【问题标题】:How to Retrieve Youtube Video Description Using Youtube API using Gdata?如何使用 Gdata 使用 Youtube API 检索 Youtube 视频描述?
【发布时间】:2012-05-27 17:05:34
【问题描述】:

我使用 YouTube 视频上传 API 将视频从我的网站上传到 YouTube,但是我还需要检索提供其 url 的视频的视频描述。 我用了这条线

<?php $entry= getVideoEntry("kNUBV9trDoA"); echo $entry->getVideoDescription();?>

我使用 require 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');

但是当我在加载器下使用这些行时包含行 我得到这个错误

警告:include_once(Zend\Gdata\YouTube.php) [function.include-once]:打开流失败:

中没有这样的文件或目录

它们都在那个文件夹中,但是 php 脚本无法加载它们路径都正确我已经检查过。

我应该如何使用此 API 检索 YouTube 视频的视频描述我需要什么文件我需要如何初始化或者是否有更简单的方法通过提供 YouTube 的 URL 或视频 ID 来检索视频描述

问候

【问题讨论】:

    标签: php zend-framework youtube-api gdata-api zend-gdata


    【解决方案1】:

    您没有正确输入视频。应该是:

    // 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。

    【讨论】:

      猜你喜欢
      • 2016-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-18
      • 2012-05-06
      • 2011-10-16
      • 1970-01-01
      • 2019-01-06
      相关资源
      最近更新 更多