C# Youtube API无效搜索查询无效搜索筛选器错误
我正试图通过YouTube API访问我的私人视频。 当我的应用程序执行请求时,我当前收到一个错误 请求包含无效的搜索筛选器和/或限制组合。请注意,如果为eventType、videoCaption、videoCategoryId、videoDefinition、videoDimension、videoDuration、VideoEmbeddeble、videoLicense、videoSyndicated或videoType参数设置值,则必须将type参数设置为video 我将ForMine设置为true,并将Type属性设置为video,因此我不确定它为什么不起作用 我从fiddler向Youtube发送的请求:C# Youtube API无效搜索查询无效搜索筛选器错误,c#,youtube,youtube-data-api,google-apis-explorer,C#,Youtube,Youtube Data Api,Google Apis Explorer,我正试图通过YouTube API访问我的私人视频。 当我的应用程序执行请求时,我当前收到一个错误 请求包含无效的搜索筛选器和/或限制组合。请注意,如果为eventType、videoCaption、videoCategoryId、videoDefinition、videoDimension、videoDuration、VideoEmbeddeble、videoLicense、videoSyndicated或videoType参数设置值,则必须将type参数设置为video 我将ForMine设
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();
任何帮助都将不胜感激,谢谢 将
forMine:true
和type:video
放在不带ChannelID
的位置,或将ChannelID
和type:video
放在不带forMine的位置
希望能有帮助。非常感谢您,这解决了它!