【发布时间】: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