I want to let my website's user to upload their video to YouTube, but is through my youtube account.That is, all the video uploaded will store in my YouTube account.
I've used the ClientLogin method :
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_YouTube');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
$developerKey = 'key';
$applicationId = 'Video uploader v1';
$clientId = 'My video upload client - v1';
$authenticationURL= 'https://www.google.com/accounts/ClientLogin';
$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
$username = 'myaccount@gmail.com',
$password = 'mypassword',
$service = 'youtube',
$client = null,
$source = 'TestUpload', // a short string identifying your application
$loginToken = null,
$loginCaptcha = null,
$authenticationURL);
$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
// then do uploadI success, but I suddenly saw that the "ClientLogin" has been deprecated ... and the Documents recommend me to migrate to Oauth2.
But I don't know how to use oauth2 to do the same thing.
It seems that oauth2 can only let user to grant and use their account, but can not use the account I provide ...
Can someone help me?
Thanks,
And sorry for my bad English.
-- You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/tBHgGxg-yjkJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
No comments:
Post a Comment