YouTube API and brand account
Asked Answered
K

1

8

I am using, since a long time, a Google script that accesses my YouTube channel, gets and modifies some information from it and saves some data in a Google sheet.

It always worked fine, but then, about a week ago, Google somehow split my access rights between my normal account (primary email) and my YouTube account (that goes under a different nickname).

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 prompts me with an authorization page and I can choose between 2 accounts. One is my primary account, the other is the YouTube one. If I choose my primary account, the code runs but I cannot see the data of the YouTube account.

If I choose the YouTube one, I still cannot access the data I want and it keeps asking for permission every time I run the code.

I understand there is a problem of authorization between the two channels, but I did not have it before and cannot find any suggestion to solve it.

What can I resolve this problem?

Kazachok answered 10/6, 2017 at 10:4 Comment(5)
Instead of mine have you tried a channelId?Kablesh
Yes, I tried that and few other options, using both the code of the script and directly within the google API interface, but could not solve itKazachok
Could you post the related code snippets for your sign-in? I'm thinking there might something new related to the scopes related to auth. Have you also tried using your YouTube account to generate the data?Sister
The relevant part of code is what I posted in my question. A request to YouTube API v3 to return the list of channels I am subscribed to. This is the code of a simplified full script: function myFunction() { var my_playlists = YouTube.Playlists.list('snippet', mine:true, maxResults:50}).items; Logger.log(my_playlists)} Scripts have to be authorized. That happens with a google sign in window, the first time you run the code. Now, running the code I have to choose which account to authorize (primary or youtube), but both fail to return those data.Kazachok
Still no reply here :(Kazachok
L
2

I've been struggling with the exact same issue but for another cause. Anyways, so far I can manipulate anything I want within my PERSONAL youtube account, granting access using OAuth to MY ACCOUNT, but if grant access to my branded account, the script doesn't even begin, apparently it's a bug that causes loop in the script.

You can check this out for more info:

Lahdidah answered 16/1, 2019 at 21:19 Comment(1)
have you found ny solution to that? having same problem.Julietajulietta

© 2022 - 2024 — McMap. All rights reserved.