YouTube API and Brand Account
I have been using since for a long time a Google script that accesses my YouTube channel, receives and modifies some information from it, and stores some data in a google sheet.
It always worked fine, but then, about a week ago, Google somehow split my access rights between my regular account (primary email) and my YouTube account (which runs under a different alias).
I cannot find a way to run even the simplest command:
var my_playlists = YouTube.Playlists.list('snippet', {
mine: true,
maxResults: 50,
})
.items;
The problem is that google now offers me a login page and I can choose between two accounts. One is my main account, the other is YouTube. If I select my primary account, the code runs, but I cannot see the YouTube account details.
If I choose YouTube, I still can't access the data I want and it keeps asking for permissions every time I run the code.
I understand that there is an authorization issue between the two channels, but I have not had one before and cannot find any suggestions for solving it.
What can I solve this problem?
source to share
I was struggling with exactly the same problem, but for a different reason. Anyway, so far I can manipulate whatever I want in my PERSONAL YouTube account by giving OAuth access to MY ACCOUNT, but if I give access to my branded account, the script doesn't even run, so it appears to be a bug that is calling the loop in the script.
You can check this for more information:
- Can the YouTube App Scripting API only run on accounts that don't have a YouTube channel?
- https://issuetracker.google.com/issues/36764531
- https://mashe.hawksey.info/2017/09/identity-crisis-using-the-youtube-api-with-google-apps-script-and-scheduling-live-broadcasts-from-google-sheets/
- Using Youtube Data API to Edit with Brand Playlist
source to share