I 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?