Loading...

youtube-api-gdata@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

[YouTube-API] Re: Zend youtube api "Error 401 NoLinkedYouTubeAccount" Jeffrey Posnick Tue Feb 21 11:01:44 2012

Hello,

 I'm asking around internally about any potential reason why you'd be
seeing this all of a sudden, and will follow up on this thread. Could
you let me know what username you're trying to log in as?

 There's some general information about the NoLinkedYouTubeAccount
error at

  http://apiblog.youtube.com/2011/10/introducing-google-account-support-and.html

but I am not sure why you'd start seeing it for an account that
previously had no issues.

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev

On Feb 21, 12:46 pm, Bob <[EMAIL PROTECTED]> wrote:
> I have same problem, i just got started with this youtube api. It
> worked great yesterday but now i am getting this error when i use
> direct upload.
> here is the code i am using.
>
> session_start();
>
> require_once 'Zend/Loader.php'; // the Zend dir must be in your
> include_path
> Zend_Loader::loadClass('Zend_Gdata_YouTube');
> $yt = new Zend_Gdata_YouTube();
> Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
>
> $authenticationURL= 'https://www.google.com/accounts/ClientLogin';
> $httpClient =
>   Zend_Gdata_ClientLogin::getHttpClient(
>               $username = '',
>               $password = '',
>               $service = 'youtube',
>               $client = null,
>               $source = 'aaa', // a short string identifying your
> application
>               $loginToken = null,
>               $loginCaptcha = null,
>               $authenticationURL);
>
> $developerKey = '--';
> $applicationId = null;
> $clientId = null;
>
> $yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId,
> $developerKey);
>
> // Note that this example creates an unversioned service object.
> // You do not need to specify a version number to upload content
> // since the upload behavior is the same for all API versions.
>
> // create a new VideoEntry object
> $myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();
>
> // create a new Zend_Gdata_App_MediaFileSource object
> $filesource = $yt->newMediaFileSource('aaa.flv');
> $filesource->setContentType('video/flv');
> // set slug header
> $filesource->setSlug('aaa.flv');
>
> // add the filesource to the video entry
> $myVideoEntry->setMediaSource($filesource);
>
> $myVideoEntry->setVideoTitle('My Test Movie');
> $myVideoEntry->setVideoDescription('My Test Movie');
> // The category must be a valid YouTube category!
> $myVideoEntry->setVideoCategory('Autos');
>
> // Set keywords. Please note that this must be a comma-separated
> string
> // and that individual keywords cannot contain whitespace
> $myVideoEntry->SetVideoTags('cars, funny');
>
> // set some developer tags -- this is optional
> // (see Searching by Developer Tags for more details)
> $myVideoEntry->setVideoDeveloperTags(array('mydevtag',
> 'anotherdevtag'));
>
> // set the video's location -- this is also optional
> $yt->registerPackage('Zend_Gdata_Geo');
> $yt->registerPackage('Zend_Gdata_Geo_Extension');
> $where = $yt->newGeoRssWhere();
> $position = $yt->newGmlPos('37.0 -122.0');
> $where->point = $yt->newGmlPoint($position);
> $myVideoEntry->setWhere($where);
>
> // upload URI for the currently authenticated user
> $uploadUrl = 'http://uploads.gdata.youtube.com/feeds/api/users/default/
> uploads/';
>
> // try to upload the video, catching a Zend_Gdata_App_HttpException,
> // if available, or just a regular Zend_Gdata_App_Exception otherwise
> try {
>         $newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl,
> 'Zend_Gdata_YouTube_VideoEntry');} catch (Zend_Gdata_App_HttpException 
> $httpException) {
>
>         echo $httpException->getRawResponseBody();} catch 
> (Zend_Gdata_App_Exception $e) {
>
>         echo $e->getMessage();
>
> }
>
> On Feb 21, 6:55 pm, YouTubeNewbie <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>
> > I've encountered something odd. I'm uploading videos to YouTube using
> > my gmail address, gmail password, and YouTube developer key. I've been
> > successful many times during testing. Without having changed my
> > credentials, I am suddenly getting a "NoLinkedYouTubeAccount" error.
> > My GMail is linked to my YouTube account.
>
> > Any ideas what's wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"YouTube APIs Developer Forum" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/youtube-api-gdata?hl=en.