YouTube API를 통해 비공개 동영상에 액세스하려고합니다. 앱에서 다음과 같은 요청을 실행하면 오류가 발생합니다.Youtube API invalid search query invalidSearchFilter 오류
"요청에 잘못된 검색 필터 및/또는 제한 조합이 포함되어 있습니다. 형식 매개 변수를 video로 설정해야합니다. videoType, videoCaption, videoCategoryId, videoDefinition, videoDimension, videoDuration, videoEmbeddable, videoLicense, videoSyndicated 또는 videoType 매개 변수가 있습니다. "
ForMine을 true로 설정하고 Type 속성을 비디오로 설정 했으므로 왜 작동하지 않는지 확신 할 수 없습니다. 내가 피들러에서 유튜브에 보내고있다
요청 :
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();
어떤 도움을 주시면 감사하겠습니다, 감사합니다!
고맙습니다. – Jen