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); }
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(); }
public OptionsManager(SafeSearchLevel.Enum level = Core.Youtube.SafeSearchLevel.Enum.All) { SafeSearchLevel = level; }