public YouTubeDataProvider(YouTubeDataConfig config) : base(config) { switch (_config.QueryType) { case "videos": _parser = new YouTubeSearchParser(); break; case "channels": case "playlist": default: _parser = new YouTubePlaylistParser(); break; } }
public override async Task <IEnumerable <YouTubeSchema> > LoadDataAsync(YouTubeDataConfig config) { IParser <YouTubeSchema> parser = null; if (config != null) { switch (config.QueryType) { case YouTubeQueryType.Videos: parser = new YouTubeSearchParser(); break; case YouTubeQueryType.Channels: case YouTubeQueryType.Playlist: default: parser = new YouTubePlaylistParser(); break; } } return(await LoadDataAsync(config, parser)); }