English 中文(简体)
如何使用 Youtube API 使用 Gdata 获取 Youtube 视频描述?
原标题:How to Retrieve Youtube Video Description Using Youtube API using Gdata?

I used YouTube video upload API to upload video from my site to YouTube, however I also need to retrieve video description of a video providing its url. I used this line

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

我用zend 装载器来操作这些线

include("Zend/Loader.php");

但当我这样做并在服务器上运行 PHP 文件时, 我得到这个错误

Fatal error: Call to undefined function getVideoEntry()

我相信装载器文件 装载所有操作所需的文件

php 中也有这些线条 。

Zend_Loader::loadClass( Zend_Gdata_YouTube );
Zend_Loader::loadClass( Zend_Gdata_AuthSub );
Zend_Loader::loadClass( Zend_Gdata_App_Exception );

but when i use those lines under loader include line i get this error

警告: 包括_ once( ZendGdataYouTube.php) [函数. include- cece- include- cecece]: 无法打开流: 没有此文件或目录

它们都在文件夹中, 但php 脚本无法装入它们, 路径都是正确的, 我已经检查过 。

我该如何使用这个 API 获取YouTube视频视频的视频描述? 需要什么样的文件才能要求我如何初始化, 或是否有更简单的方法通过提供 URL 或视频id 来获取视频描述?

观 观 观

最佳回答

您没有正确获取您的视频条目。 它应该 :

// 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();

阅读 < a href=>" "https:// developmenters.google.com/youtube/2.0/ Developers_guide_php#Retreving_Video_Entry" rel= "no follow" >Retreging 文档。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签