コード例 #1
0
 public async Task<YuotubeQueryResponse> Search(string query, SafeSearchLevel.Enum safeSearchLevel)
 {
     var LastResponses = new Dictionary<TypeResult, SearchListResponse>();
     LastResponses.Add(TypeResult.video, await SearchVideos(query, safeSearchLevel));
     LastResponses.Add(TypeResult.playlist, await SearchPlaylists(query, safeSearchLevel));
     LastResponses.Add(TypeResult.channel, await SearchChannels(query, safeSearchLevel));
     return new YuotubeQueryResponse(LastResponses);
 }
コード例 #2
0
 private async Task<SearchListResponse> SearchChannels(string query, SafeSearchLevel.Enum safeSearchLevel)
 {
     var searchListRequest = serviceContainer.Service.Search.List("snippet");
     searchListRequest.Q = query;
     searchListRequest.SafeSearch = SafeSearchLevel.Level[safeSearchLevel];
     searchListRequest.MaxResults = 20;
     searchListRequest.Type = TypeResult.channel.ToString();
     return await searchListRequest.ExecuteAsync();
 }
コード例 #3
0
 public OptionsManager(SafeSearchLevel.Enum level = Core.Youtube.SafeSearchLevel.Enum.All)
 {
     SafeSearchLevel = level;
 }