How to request if you have multiple channels in a single Google account on YouTube data api

Asked 1 years ago, Updated 1 years ago, 75 views

I am using Youtube data apiv3 with a client for Java.

YouTube.Channels.List channelRequest=youTube.channels().list("id, snippet, contentDetails");
channelRequest.setMine(true);
channelRequest.setMaxResults(10L);
channelRequest.setFields("items(id, snippet/title)");
channelRequest.setOauthToken(mToken);
ChannelListResponse channels = channelRequest.execute();
List<Channel>listOfChannels=channels.getItems();

I am requesting the channel ID of the authenticated user in this way, but even if the user has more than one channel, one response is not received.
If you have multiple channels under one account, how can you request it?

android java youtube-data-api

2022-09-29 22:18

2 Answers

Because the account (token) and channel are one-to-one, only one channel is returned in one token.
When a user has multiple channels, a virtual account is created and associated with the second and subsequent channels.
o When authenticating Auth, users with multiple channels will see the "Channel Select" screen, and depending on the selected channel, another token will be returned.


2022-09-29 22:18

https://stackoverflow.com/questions/26515743/youtube-api-channel-selector
It seems that the channel cannot be selected for OAuth2 authentication method currently built in Android.I will implement it on the webview.


2022-09-29 22:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.