如何仅使用 videoId 从 Google Apps 脚本 API 更新 Youtube 上的 snippet.description?

How to update the snippet.description on Youtube from Google Apps Script API using only the videoId?

我想使用通过 Google Apps 脚本公开的 API 在我的 Youtube 频道上更新我的 snippet.description。我已经知道 videoId,所以不需要像 show in the example here.

那样创建和循环搜索列表

我希望在我的 Youtube 视频中看到我的脚本和新的描述。但是我收到了以下错误消息。

API call to youtube.videos.update failed with error: Forbidden (line 90, file "Youtube")

Code.gs
function updateVideo( data ) {
  var videoId = 'foo';
  var title = 'bar';
  var description = 'baz';
  var resource = {
    id: videoId,
    snippet: {
      title: title,
      description: description,
      categoryId: '22'
    }
  };
  YouTube.Videos.update(resource, 'id,snippet'); // this is line 90
}

我做错了什么?

备注

澄清一下:"only the videoId",我的意思是不创建频道列表来找到它 like they do here

var myChannels = YouTube.Channels.list('contentDetails', {mine: true});

编辑

这个问题是不同的,因为另一个问题专门询问 HTML。这个问题不是关于在描述中使用 HTML 。这是关于对描述进行任何更改。

评论总结:

这是授权错误。发出 API 请求的帐户与 YouTube 视频所有者的帐户不同。