How can I upload video to a specific YouTube channel using Apps Script?

50 views
Skip to first unread message

Виктор Кравцов

unread,
Jan 16, 2023, 8:15:03 AM1/16/23
to Google Apps Script Community

 am trying to post a video to one of my brand Youtube accounts. But when I use apps script, I cannot choose to what channel video should be uploaded.

May be there is any way to specify channel, or use brand accounts to upload videos?

Here is my code:

function PostVideoToYT(channel_id, video_url, title, description) { const sourceFile = UrlFetchApp.fetch(video_url, { muteHttpExceptions: true }).getBlob(); const videoResource = { snippet: { title: title, description: description, channelId:"UCNywJdNO5K6edWupWD6opVw", }, status: { privacyStatus: 'private' }, }; const newVideo = YouTube.Videos.insert(videoResource, "snippet,status", sourceFile); // Modified Logger.log(newVideo) return newVideo; }

How can I specify channel id?

Reply all
Reply to author
Forward
0 new messages