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

YouTubeAPI无效搜索查询无效SearchFilter错误

翟鸿振
2023-03-14

我正试图通过YouTube API访问我的私人视频。当前,当我的应用程序执行请求时,我收到一个错误,错误如下:

"请求包含无效的搜索筛选器和/或限制组合。请注意,如果为eventType、videoCaption、videoCategoryId、videoDefinition、videoDimension、videoDuration、videoEmbeddable、videoLicense、videoSyndicated或videoType参数设置了值,则必须将type参数设置为video。

我已经设置为真实的,并已设置类型属性为视频,所以我不知道为什么它不工作。

我从fiddler发送到Youtube的请求:

GET /youtube/v3/search?part=snippet&channelId=XXXXXX&forMine=True&maxResults=1&order=date&type=video HTTP/1.1
User-Agent: Youtube Sample google-api-dotnet-client/1.21.0.0 (gzip)
Authorization: XXXXX
Host: www.googleapis.com
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

代码是:

string[] scopes =
        {
            YouTubeService.Scope.YoutubeReadonly
        };


        try
        {
            var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(new ClientSecrets { ClientId = clientId, ClientSecret = clientSecret }
                                                                                         , scopes
                                                                                         , "user"
                                                                                         , CancellationToken.None
                                                                                         , new FileDataStore("Youtube.Auth.Store")).Result;

            var youtubeService = new YouTubeService(new BaseClientService.Initializer
            {
                HttpClientInitializer = credential,
                ApplicationName = "Youtube Sample"
            });

            var searchListRequest = youtubeService.Search.List("snippet");
            searchListRequest.MaxResults = 1;
            searchListRequest.Type = "video";
            searchListRequest.ForMine = true;
            searchListRequest.Order = SearchResource.ListRequest.OrderEnum.Date;
            searchListRequest.ChannelId = "XXXXX";

            var searchListResponse = searchListRequest.Execute();

任何帮助将不胜感激,谢谢!

共有1个答案

栾峰
2023-03-14

要么输入 forMine: true键入: 没有 ChannelID 的视频,要么输入 ChannelID键入: 没有 forMine 的视频

希望有帮助。

 类似资料:
  • 嗨,我是新来spring boot的。我尝试连接到Oracle并列出相关记录。我的代码是在存根环境中工作的,也就是说没有连接到DB。当我试图从spring连接到数据库时,我得到了编辑2中给出的错误: 家庭控制者 POST实体类 Users实体类 存储库 服务 服务实现 至于我在DB中的表: 附注。我还通过更改存储库尝试了以下操作: 这次我出现了以下错误: 我错过了什么? 提前道谢! 编辑: pom

  • 问题内容: 我不是从PHP运行命令! 我将MySQL log_error值设置为/var/log/mysql/error.log 但是,当我连接到数据库并运行SQL命令时,该错误不会出现在日志中。 有从某种Windows应用程序运行的命令。我只想知道什么无效命令发送给MySQL服务器,以便我尝试解决它们。 问题答案: 错误日志无法做到这一点:https : //dev.mysql.com/doc/

  • 我只是想在youtube上搜索我自己的视频,在X日期后发布 然而,当我使用< code>publishAfter参数时,即使我将< code>type参数设置为< code>video,也会出现< code>invalidSearchFilter错误。 错误描述如下: 该请求包含无效的搜索过滤器和/或限制组合。请注意,如果您将或参数设置为,则必须将参数设置为,如果您为、、、、、、、、或参数设置值,

  • 我在使用Python弹性搜索访问数据时遇到了一个问题。我正在得到 尝试使用时出错 我的弹性搜索版本6.5。4,python版本3.7。2.

  • 在AS400中,我如何对字段执行算术运算(如,-)。 对于查询,在德语中获取以下错误msg"[IBM][System i Access ODBC-Treiber][DB2 für i5/OS]SQL0104-Token 有人能告诉我我的sql查询有什么问题吗?