致命错误:未捕获的异常'Zend_Gdata_App_HttpException',消息'预期响应代码200,得到401'

时间:2013-06-22 00:07:25

标签: php youtube youtube-api

我正在使用已经工作多年的php脚本,但突然间它以

中止
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with
message 'Expected response code 200, got 401'  

NoLinkedYouTubeAccount
Error 401

它就像这样开始

<?php

function anmelden_yt($name,$passwort)
{
$yt_source = 'known';  
$yt_api_key = 'key';
$yt = null;    
$authenticationURL= 'https://www.google.com/accounts/ClientLogin';  
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(  
$username = $name,  
$password = $passwort,  
$service = 'youtube',  
$client = null,  
$source = $yt_source, // a short string identifying your application  
$loginToken = null,  
$loginCaptcha = null,  
$authenticationURL); 
abschnitt("Login");
return new Zend_Gdata_YouTube($httpClient, $yt_source, NULL, $yt_api_key); 
}


require_once("Zend/Gdata/ClientLogin.php");  
require_once("Zend/Gdata/HttpClient.php");  
require_once("Zend/Gdata/YouTube.php"); 
require_once("Zend/Gdata/App/MediaFileSource.php");  
require_once("Zend/Gdata/App/HttpException.php");  
require_once('Zend/Uri/Http.php');
require_once 'Zend/Loader.php'; 
Zend_Loader::loadClass('Zend_Gdata_YouTube'); 
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); 

$yt = anmelden_yt($name,$pass);
$videoFeed = $yt->getUserUploads('Google');
sleep(0.5);
    @ob_flush();
@flush();

?>

这可能是什么原因? .................................................. ................................................

1 个答案:

答案 0 :(得分:0)

Google帐户与基础YouTube频道之间的链接出现了问题。也许该频道最近已迁移,因此它与Google+信息页而非Google帐户相关联?

以下是一些相关的博客文章,更详细地解释了这些内容: