我正在使用一个已经工作多年的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();
?>
这可能是什么原因呢?..................................................................................................
Google帐户和底层YouTube频道之间的链接发生了一些事情。也许这个频道最近被迁移了,所以它被链接到一个Google+页面,而不是一个Google帐户?
这里有一些相关的博客文章,更详细地解释了事情:
- 介绍Google帐户支持和YouTube API v2.1
- ClientLogin #失败
- Google+页面标识和YouTube API