Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube v3 API upload to channel

I have to migrate my PHP scripts using YouTube's v2 API to v3.

I'm trying this example to upload a video:

https://developers.google.com/youtube/v3/code_samples/php#resumable_uploads

I can authenticate my Google account for my app, the only problem is that the video is being uploaded to my Google+ YouTube channel and not to my original channel. (They both belong to the same Google account).

I was not able to solve this problem with the v2 API but selecting the "default" channel in "Channel switcher" (https://www.youtube.com/channel_switcher) did help.

How can I tell the v3 API which channel to upload to?

like image 313
paha Avatar asked Apr 20 '15 21:04

paha


People also ask

Can you upload videos with YouTube API?

Stay organized with collections Save and categorize content based on your preferences. This guide provides and explains a Python script that uploads a YouTube video using the YouTube Data API. The code uses the Google APIs Client Library for Python.

Can I give someone access to upload to my YouTube channel?

To add access:Go to studio.youtube.com. On the left-hand side, click Settings. Click Permissions. Click Invite and enter the email address of the person you'd like to invite.

Is YouTube data API v3 free?

Yes, using the YouTube API does not incur any monetary cost for the entity calling the API. If you go over your quota an 403 Error will be returned by the API.


1 Answers

As of writing, the ability to choose which channel to upload a video to is only available to YouTube content partners.

The videos.insert method supports an optional parameter onBehalfOfContentOwnerChannel, which takes in a a YouTube channel ID value as a string. You must also provide your YouTube CMS auth credentials for the onBehalfOfContentOwner parameter as well.

YouTube provides some explanation:

This [onBehalfOfContentOwnerChannel] parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.

Relevant API documentation for videos.insert here.

like image 123
JAL Avatar answered Sep 28 '22 08:09

JAL