【问题标题】:Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 401'致命错误:未捕获的异常 'Zend_Gdata_App_HttpException' 带有消息 'Expected response code 200, got 401'
【发布时间】:2013-06-22 00:07:25
【问题描述】:

我正在使用一个已经工作多年的 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();

?>

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

【问题讨论】:

  • 我也遇到了同样的问题,从 6 月 12 日/13 日开始。我正在使用 ClientLogin,但使用它从 Google Play 下载 CSV。我的脚本工作了大约 8 个月,但突然停止了。谷歌肯定在幕后改变了一些东西,不仅仅是为了 Youtube。这发生在多个帐户上。

标签: php youtube youtube-api


【解决方案1】:

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

以下是一些相关的博客文章,对事情进行了更详细的解释:

【讨论】:

    猜你喜欢
    • 2013-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-09
    • 2013-08-24
    • 2012-04-25
    • 2014-03-17
    • 2012-03-14
    相关资源
    最近更新 更多