youtube-api - 获取从使用 Youtube api 的帐户管理的频道列表?
问题描述
我正在尝试使用 Youtube api 和 oath2.0 检索从 1 个帐户管理的频道列表。我正在创建一个控制台应用程序,以设置 oath2.0 我在开发人员控制台中创建了其他应用程序类型。现在,当我第一次运行该应用程序时,它会启动浏览器并要求我进行身份验证并选择一个频道。这是我用于身份验证的代码:'''
CancellationTokenSource cts = new CancellationTokenSource();
cts.CancelAfter(TimeSpan.FromSeconds(20));
CancellationToken ct = cts.Token;
UserCredential credential;
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "XXXXXX",
ClientSecret = "XXXXX"
},
new[] { YouTubeService.Scope.YoutubeForceSsl, YouTubeService.Scope.Youtube, YouTubeService.Scope.YoutubeUpload, YouTubeService.Scope.YoutubepartnerChannelAudit, YouTubeService.Scope.Youtubepartner },
"<UserID>",
ct,
new FileDataStore(this.GetType().ToString())
);
var youtubeService = new YouTubeService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = this.GetType().ToString()
});
'''
由于我只选择了 1 个频道,因此我无法获取帐户中管理的所有频道的列表。
我正在尝试使用以下 api 访问频道:
'''
var channelsinStream = youtubeService.Channels.List("snippet,contentDetails,statistics");
channelsinStream.Mine = true;
var channelresponse = await channelsinStream.ExecuteAsync();
'''
这样做的主要座右铭是在添加频道后删除频道中的所有实时视频。我们有接近 100 个频道,因此每次都很难通过每个频道来删除它们。
解决方案
推荐阅读
- java - 如何使用 Youtube Java API 从频道中获取所有视频的列表?
- paypal - 贝宝沙箱通知不起作用
- javascript - Adonis 5.0 TypeError:无法读取未定义的属性“长度”
- javascript - config.kit.adapter 应该是一个带有“adapt”方法的对象
- javascript - 使用 Axios 的 POST 方法只在数据库中插入 ID。反应 JS
- javascript - 有人可以向我解释我写的这个 leetcode 解决方案的空间复杂度吗?
- ios - iOS 应用程序在尝试安装 Codepush 更新时崩溃并且还会发生更新回滚
- mysql - 检索特定月份内但小于当年和小于当天的MySql记录
- google-cloud-platform - 是什么导致我的“/dev/sda1”目录的文件大小增加,如何减小整体大小?
- python - Scrapy Request: TypeError(f'Request url must be str or unicode, got {type(url).__name__}'