Example #1
0
        public static YtStore YtStore(this Cfg cfg, ILogger log)
        {
            var reader  = new YtClient(cfg.App, log);
            var ytStore = new YtStore(reader, cfg.DataStore(cfg.App.Storage.DbPath));

            return(ytStore);
        }
 public YtDataUpdater(YtStore store, AppCfg cfg, UpdateType updateType, Func <Task <DbConnection> > getConnection, ILogger log)
 {
     UpdateType    = updateType;
     GetConnection = getConnection;
     Store         = store;
     Cfg           = cfg;
     Log           = log;
     Scraper       = new YtScraper(cfg.Scraper);
     Api           = new YtClient(cfg.YTApiKeys, log);
 }
Example #3
0
        public YtStore(YtClient reader, ISimpleFileStore store)
        {
            Yt    = reader;
            Store = store;

            Videos   = new FileCollection <VideoStored>(Store, v => v.VideoId, "Videos", Yt.Cfg.CacheType, CacheDataDir);
            Channels = new FileCollection <ChannelStored>(Store, v => v.ChannelId, "Channels", Yt.Cfg.CacheType, CacheDataDir);
            RecommendedVideosCollection = new FileCollection <RecommendedVideoStored>(Store, v => v.VideoId, "RecommendedVideos", Yt.Cfg.CacheType, CacheDataDir);
            ChannelVideosCollection     = new FileCollection <ChannelVideosStored>(Store, c => c.ChannelId, "ChannelVideos", Yt.Cfg.CacheType, CacheDataDir);
        }
Example #4
0
 public YtCollector(YtStore store, AppCfg cfg, SnowflakeConnectionProvider sf, IPipeCtx pipeCtx, WebScraper webScraper, ChromeScraper chromeScraper,
                    YtClient api)
 {
     Store         = store;
     Cfg           = cfg;
     Sf            = sf;
     PipeCtx       = pipeCtx;
     Scraper       = webScraper;
     ChromeScraper = chromeScraper;
     Api           = api;
 }