Exemplo n.º 1
0
        public YouTubeDataProvider(YouTubeDataConfig config)
            : base(config)
        {
            switch (_config.QueryType)
            {
            case "videos":
                _parser = new YouTubeSearchParser();
                break;

            case "channels":
            case "playlist":
            default:
                _parser = new YouTubePlaylistParser();
                break;
            }
        }
Exemplo n.º 2
0
        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));
        }