admin管理员组文章数量:1399234
Google Apps Script offers to interact with the YouTube API by adding the YouTube Data API v3 as an advanced service and then using the YouTube class. This works fine for me when I handle requests like fetching video details. But it doesn't work with updating a video, or getting my own videos - i.e. requests that require OAuth2.
Important: My YouTube channel has a brand account. So when I authenticate the script, I select that account.
Here is a simple example. I create a new script () and execute the function below.
function showMyChannels() {
const channels = YouTube.Channels.list(["snippet"], { mine: true });
console.log(channels)
}
When this function is running for the first time, an OAuth2 authentication flow is triggered in a popup. When I select my personal Google account, it works, and the list of channels is empty. However, when I select my YouTube brand account, it does not work:
- The authentication flow in the popup seems to have finished.
- The script is also visible as a 3rd party on the page , as it should be.
- However, the Google Apps Script console writes:
"Access to your Google account is required to run this project. Please try again and allow access this time." (translated with DeepL, my interface is in German).
How to fix this?
Let me say that I can actually update my videos programmatically within a Node.js application, the googleapis Node.js client and the whole refresh token procedure. (In that setting I also needed to select my brand account, by the way.) That is much more complicated. I hope it is easier with Google Apps Script, but I cannot get any update script running for my brand account.
I also tried to change the GCP project of the script from the default one to a dedicated one. This didn't fix the issue either.
I retried several times, also in Incognito.
Screenshots
Sorry, they are in German, but I think it is better to include them nevertheless.
From it seems like the script has been authorized:
Yet, the console throws an error:
本文标签: YouTube update not authorized in Google Apps ScriptStack Overflow
版权声明:本文标题:YouTube update not authorized in Google Apps Script - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744172956a2593869.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论