0

hi
When I try to load a new video this message appears

Sometimes this message appears and sometimes does not show

Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 403 <?xml version='1.0' encoding='UTF-8'?><errors><error><domain>yt:quota</domain><code>too_many_recent_calls</code></error></errors>' in /home/******/public_html/Zend/Gdata/App.php:709 Stack trace: #0 /home/******/public_html/Zend/Gdata.php(221): Zend_Gdata_App->performHttpRequest('GET', 'http://gdata.yo...', Array, NULL, NULL, NULL) #1 /home/*******e/public_html/Zend/Gdata/App.php(875): Zend_Gdata->performHttpRequest('GET', 'http://gdata.yo...', Array) #2 /home/*******/public_html/Zend/Gdata/App.php(763): Zend_Gdata_App->get('http://gdata.yo...', NULL) #3 /home/*********/public_html/Zend/Gdata/App.php(220): Zend_Gdata_App->importUrl('http://gdata.yo...', 'Zend_Gdata_YouT...', NULL) #4 /home/********/public_html/Zend/Gdata.php(187): Zend_Gdata_App->getEntry('http://gdata.yo...', 'Zend_Gdata_YouT...') #5 /home/********/public_html/Zend/Gdata/YouTube.php(293): Zend_Gdata->getEntry('http://gdata.yo...', 'Zend_Gdata_YouT in /home/*********/public_html/Zend/Gdata/App.php on line 709

and this my code

require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');
$yt = new Zend_Gdata_YouTube();
$yt->setMajorProtocolVersion(2);
$videoEntry = $yt->getVideoEntry($_post[videoid]);
$videoname= $videoEntry->getVideoTitle();
$videoThumb=$videoEntry->videoThumbnails[0]['url'];
$duration=$videoEntry->getVideoDuration();
.
.
.
.
3
Contributors
17
Replies
20
Views
6 Years
Discussion Span
Last Post by aloul84
0

403 usually means that you are forbidden or unauthorized from accessing it. Are you making too many calls to it?

<errors><error><domain>yt:quota</domain><code>too_many_recent_calls</code></error></errors>

0

403 usually means that you are forbidden or unauthorized from accessing it. Are you making too many calls to it?

what kind of authorizing i should use , and i call the youtube api just once;

and how i can avoid many calls

Edited by aloul84: n/a

0

Do you need an API key? I'm afraid I'm not too familiar with this setup. Just a couple of things that suggested themselves from the error message.

0

Are we solved?

not yet ,but its a good tutorial to learn a new things

0

SO what else do you need?

just ,What causes this problem?

0

finally
i got a code without use zend on my server by use xml

<?
$feedURL = "http://gdata.youtube.com/feeds/api/videos/uxofhQ-2oNg";
$sxml = simplexml_load_file($feedURL);
$embed = "http://www.youtube.com/v/uxofhQ-2oNg";
$title = $sxml->title;
echo "title : $title ";
?>

but one step still missing

how i can save time duration from generated xml file to a php variable to use it in my code

so how i can get atime duration like this

$title = $sxml->title;

this is the xml file that genrated

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007'>
    <id>http://gdata.youtube.com/feeds/api/videos/uxofhQ-2oNg</id>
    <published>2011-04-12T00:15:33.000Z</published>
    <updated>2011-07-07T19:52:05.000Z</updated>
    <category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/categories.cat' term='People' label='People &amp; Blogs'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Liverpool'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Manchester'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='City'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Premier'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='League'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Full'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Highlights'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='and'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='Goals'/>
    <category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='10/04/2011'/>
    <title type='text'>Liverpool 3 - 0 Manchester City Premier League Full Highlights and Goals 10/04/2011</title>
    <content type='text'>http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - kuyt carool carol 2 goals</content>
    <link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=uxofhQ-2oNg&amp;feature=youtube_gdata'/>
    <link rel='http://gdata.youtube.com/schemas/2007#video.responses' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/uxofhQ-2oNg/responses'/><link rel='http://gdata.youtube.com/schemas/2007#video.related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/uxofhQ-2oNg/related'/>
    <link rel='http://gdata.youtube.com/schemas/2007#mobile' type='text/html' href='http://m.youtube.com/details?v=uxofhQ-2oNg'/>
    <link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/uxofhQ-2oNg'/>
    <author>
    <name>mazaft1</name>
    <uri>http://gdata.youtube.com/feeds/api/users/mazaft1</uri>
    </author>
    <gd:comments>
    <gd:feedLink href='http://gdata.youtube.com/feeds/api/videos/uxofhQ-2oNg/comments' countHint='0'/></gd:comments>
    <media:group>
    <media:category label='People &amp; Blogs' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>People</media:category>
    <media:content url='http://www.youtube.com/v/uxofhQ-2oNg?f=videos&amp;app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='242' yt:format='5'/>
    <media:content url='rtsp://v6.cache3.c.youtube.com/CiILENy73wIaGQnYoLYPhR8auxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='242' yt:format='1'/>
    <media:content url='rtsp://v3.cache3.c.youtube.com/CiILENy73wIaGQnYoLYPhR8auxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='242' yt:format='6'/>
    <media:description type='plain'>http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - http://mazafoot.com - kuyt carool carol 2 goals</media:description>
    <media:keywords>Liverpool, Manchester, City, Premier, League, Full, Highlights, and, Goals, 10/04/2011</media:keywords>
    <media:player url='http://www.youtube.com/watch?v=uxofhQ-2oNg&amp;feature=youtube_gdata_player'/>
    <media:thumbnail url='http://i.ytimg.com/vi/uxofhQ-2oNg/0.jpg' height='240' width='320' time='00:02:01'/>
    <media:thumbnail url='http://i.ytimg.com/vi/uxofhQ-2oNg/1.jpg' height='90' width='120' time='00:01:00.500'/>
    <media:thumbnail url='http://i.ytimg.com/vi/uxofhQ-2oNg/2.jpg' height='90' width='120' time='00:02:01'/>
    <media:thumbnail url='http://i.ytimg.com/vi/uxofhQ-2oNg/3.jpg' height='90' width='120' time='00:03:01.500'/>
    <media:title type='plain'>Liverpool 3 - 0 Manchester City Premier League Full Highlights and Goals 10/04/2011</media:title>
    <yt:duration seconds='242'/></media:group>
    <gd:rating average='1.0' max='5' min='1' numRaters='4' rel='http://schemas.google.com/g/2005#overall'/>
    <yt:statistics favoriteCount='0' viewCount='3505'/></entry>
0

sorry for mark it as solved

but after i finished ,a new problem was appeared

Warning: simplexml_load_file(http://gdata.youtube.com/feeds/api/videos/t_F0CQ9jTWk) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/******/public_html/*****/prodcuts.php on line 267

Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/videos/t_F0CQ9jTWk" in /home/******/public_html/******/prodcuts.php on line 267

this error appear sometime and sometime dose not

dose that mean youtube busy at this moment or something else
and how i can show video after i verify that xml file loaded successfully from youtube server

Edited by aloul84: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.