当前位置: 首页 > 知识库问答 >
问题:

Youtube comments API引发“权限不足:请求的身份验证范围不足”错误

斜向文
2023-03-14

我试图获取Youtube评论,但它抛出了这个异常 -

{“Google.api.Requests.RequestError\r\n权限不足:请求的身份验证作用域不足。[403]\r\nErrors[\r\n\tMessage[权限不足:申请的身份验证范围不足。]位置[-]原因:[UnficificientPermissions]域[全局]\r\r\m\n”}

凭证源代码-

UserCredential credsDataApi = GoogleWebAuthorizationBroker.AuthorizeAsync(
                GoogleClientSecrets.Load(stream).Secrets,
                new[] { YouTubeService.Scope.YoutubeForceSsl, YouTubeService.Scope.Youtubepartner, YouTubeAnalyticsService.Scope.YtAnalyticsReadonly, YouTubeAnalyticsService.Scope.YtAnalyticsMonetaryReadonly, YouTubeAnalyticsService.Scope.Youtube, "https://www.googleapis.com/auth/plus.login" },

                "user",
                CancellationToken.None,
                new FileDataStore(Directory.GetCurrentDirectory() + "\\MetadataAccessToken\\" + channelinfo.DataAPIFileDataStore, true)
                ).Result; 

这是它抛出异常的行-

UserCredential credsDataApi = YouTubeHelper.GetUserCredentialForDataAPI(channelinfo);
            var youtubeServiceComments = new YouTubeService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credsDataApi,
                ApplicationName = channelinfo.DataAPIFileDataStore
            });

var searchCommentThreadlistRequest=youtubeServiceComments.CommentThreals。列表(“片段”);var searchCommentThreadlistResponse=searchCommentThreadlistRequest。ExecuteAsync();如果(searchCommentThreadlistResponse.Result.Items.Count)

你能帮忙吗?

暂时还没有答案

 类似资料:
  • 我已成功完成此处的快速入门演示: https://developers.google.com/drive/api/v3/quickstart/python 我想更进一步,开始上传文件和文件夹。为此,我将范围替换为:SCOPES=['https://www.googleapis.com/auth/drive'] 我也已经把行刑换成了 然后我得到一个错误:GoogleAppClient。错误。Http

  • 我第一次尝试使用Google Firestore,通过Google api身份验证进行身份验证。我要做的第一件事是用几个方法来填充数据库,当我等待批处理任务时,会出现以下错误: 我几乎找不到谷歌认证连接firestore的方法。首先,我使用google console为我的应用程序提供的密码使用此方法进行身份验证: 使用在我的google控制台中为应用程序配置的相同作用域(我在同一应用程序中使用g

  • 我正在尝试从我的谷歌驱动器下载一个电子表格。我正在遵循这个参考,并且在权限方面有问题。我从https://www.googleapis.com/auth/drive.file开始,得到了这个 阅读权限文档可以阅读以下内容https://www.googleapis.com/auth/drive. 访问用户所有文件(不包括应用程序数据文件夹)的完整许可范围。 但即使使用这个范围,我仍然得到相同的错误

  • null 所用程序: 获取身份验证响应后创建Google analytics service对象。/li> 脚本: null

  • 这是我为Google Sheets API编写的代码。我有这是我找到的解决此问题的方法,但这并不能解决我的问题。我已经删除了我的.Credentials文件夹,它不提示我登录。