api-samples icon indicating copy to clipboard operation
api-samples copied to clipboard

YouTube Upload Video ChannelID Parameter - Error

Open sarankup opened this issue 1 year ago • 3 comments

Hi,

I am using the Python library and here is the code to authorize.

  flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRETS_FILE, SCOPES)
  credentials = flow.run_local_server(port=8081)

Uploading part is

youtube.videos().insert(
    onBehalfOfContentOwner="#####myuserid#####",
    onBehalfOfContentOwnerChannel="#####mychannelid#####",

Initially I had created first first channel (say Channel A, the primary user channel), after sometimes, I had created one more channel (Say Channel B, Brand channel) under the same user account.

I did not specify the Channel id. The upload is successful and all is well. The video uploaded to Channel A. The problem is, I have one more channnel in the same user account, thus I have to specify the channel id. I could not find how to send the channel id.

I am not "YouTube content partners". I pass the channId to the onBehalfOfContentOwner but it fails. Please advise how to upload my own secondary channel. Here is the error I am receiving now.

googleapiclient.errors.ResumableUploadError: <HttpError 403 when requesting None returned "The authenticated user cannot act on behalf of the specified Google account.". Details: "[{'message': 'The authenticated user cannot act on behalf of the specified Google account.', 'domain': 'youtube.common', 'reason': 'accountDelegationForbidden'}]">

sarankup avatar Apr 17 '23 11:04 sarankup

you got any solution ? please replay if any i am facing similar problem

yoonusc avatar Mar 06 '24 15:03 yoonusc

Hi,

Code can upload videos to the primary channel. One account can have only one primary and multiple secondary channels.

sarankup avatar Mar 07 '24 06:03 sarankup