I'm trying to write a script that gets all of the completed YouTube live streams from one of my channels that I manage and writes some stats (view counts, etc) to a Google Spreadsheet.
My Google account is a manager for a few Google+ pages, and some of those pages are associated with YouTube Channels. The pages "own" the channels, as far as I can tell.
I throw this in Code.gs:
function updateStats() {
var liveEventsResponse = YouTube.LiveBroadcasts.list('snippet', {
maxResults: 50,
pageToken: nextPageToken
});
Logger.log(liveEventsResponse);
}
When I run a function on the script, I get this box:
I click my Google+ page and get this:
If I click "Allow" and authorize the script as my Google+ page, the box closes and everything looked like it worked. Once I try to run the function again, however, it pops up the same boxes and asks me again.
My question is: Can I use the YouTube API in Google Apps Script to get data from a YouTube Channel owned by a Google+ Page, or is that not supported?
Thanks!

