4

I have a website on which clients will be uploading videos. The thing is - I want those videos to be uploaded to OUR channel, not users' channels. I don't see how I could make it work using YouTube API v3.

Every time a person wants to upload something using the access token I provided he has to input his own credentials. He can't simply upload anything directly to OUR channel.

Is there a way to work that around?

NakedCat
  • 852
  • 1
  • 11
  • 40

3 Answers3

2

Short answer is: You should not ask your users to upload into your account.

But please read further:

https://stackoverflow.com/a/12626209/1973552

https://stackoverflow.com/a/15258781/1973552

Community
  • 1
  • 1
Ibrahim Ulukaya
  • 12,767
  • 1
  • 33
  • 36
1

Api V2 have option you've mentioned. Did you try it? Basically you want to let Users upload Videos in your website, but upload them directly to youtube, without Google AUTH?

Matt
  • 171
  • 1
  • 1
  • 8
  • 2
    I know that v2 has this option, but it's deprecated. We are developing a new website from scratch, that's why we shouldn't use deprecated solutions. If there is a possibility of uploading directly to a specific predetermined channel then I can use Google AUTH. I simply don't want users to upload videos to THEIR channels, only to OUR channel. We would also appreciate if users never had to input their YT/Google credentials and could upload the video directly to our channel. Hope I explained it well now :). – NakedCat May 06 '14 at 19:24
0

Yes you can. Make sure you set the setAccessType to offline.

$client->setAccessType("offline");

This will make it so you get a refresh Token with the users account authentication the first time. A refresh token allows you to reauthenticate without the user being present. (aka, offline). Create your script from the sample API v3 scripts, authorize your main account (the one you want to be predetermined) and display the response. Something like the following will show you your response:

print_r($client->getAccessToken()); 

You will see your refresh Token in the json response. Save that (either to a database, or hard code it into the script). Now that you have a refresh token, whenever you want to upload to youtube, just call

$client->refreshToken($THE_REFRESH_TOKEN_YOU_SAVED);
$thetoken = $client->getAccessToken();
$client->setAccessToken($thetoken);

After this, your previously authenticated account will now be currently logged into your script.

FYI, these are php examples, you might need to adjust accordingly.

Clint Decker
  • 121
  • 1
  • 3