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

Posted by Peak Reconstruction Wavelength on Stack Overflow See other posts from Stack Overflow or by Peak Reconstruction Wavelength
Published on 2013-06-22T00:07:25Z Indexed on 2013/06/25 16:21 UTC
Read the original article Hit count: 326

Filed under:
|
|

I am using a php-script that has been working for years, but suddenly it aborts with

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

NoLinkedYouTubeAccount
Error 401

It starts like this

<?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();

?>

What could be the reason for this? ..................................................................................................

© Stack Overflow or respective owner

Related posts about php

Related posts about youtube