gpt4 book ai didi

php - fatal error :消息 'Zend_Gdata_App_HttpException'未被捕获的异常 'Expected response code 200, got 401'

转载 作者:行者123 更新时间:2023-12-03 05:42:11 25 4
gpt4 key购买 nike

我正在使用已经工作多年的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 channel 之间的链接发生了问题。也许该 channel 最近已迁移,因此已链接到Google+信息页而不是Google帐户?

以下是一些相关的博客文章,它们对事情进行了更详细的说明:

  • Introducing Google Account support and YouTube API v2.1
  • ClientLogin #FAIL
  • Google+ page identities and the YouTube API
  • 关于php - fatal error :消息 'Zend_Gdata_App_HttpException'未被捕获的异常 'Expected response code 200, got 401',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17245998/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com