2017-02-12 19 views
1

YouTube APIを使用してプライベートビデオにアクセスしようとしています。 私のアプリがリクエストを実行したときにエラーが発生しましたYouTube API無効な検索クエリinvalidSearchFilterエラー

"リクエストに無効な検索フィルタや制限が含まれています。 eventType、videoCaption、videoCategoryId、videoDefinition、videoDimension、videoDuration、videoEmbeddable、videoLicense、videoSyndicated、またはvideoTypeパラメータのいずれかです。

ForMineをtrueに設定し、Typeプロパティをビデオに設定しているため、なぜ機能していないのかわかりません。私はシオマネキから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(); 

任意の助けをいただければ幸いです、ありがとう!

答えて

0

のどちらかがChannelIDなしforMine: truetype: videoを入れたりforMineなしChannelIDtype: videoを置きます。

希望します。

+0

ありがとう、これが修正されました! – Jen

関連する問題