コード例 #1
0
        public nhentaiScraper(IServiceProvider services, IOptionsMonitor <nhentaiScraperOptions> options, ILogger <nhentaiScraper> logger, IHttpClientFactory http) : base(services, options, logger)
        {
            _options = options;
            _http    = http.CreateClient(nameof(nhentaiScraper));

            _http.DefaultRequestHeaders.TryAddWithoutValidation("Accept", "*/*");
            _http.DefaultRequestHeaders.TryAddWithoutValidation("Accept-Language", "en");
            _http.DefaultRequestHeaders.TryAddWithoutValidation("Referer", "https://nhentai.net");
            _http.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", ScraperAgent.GetUserAgent());

            TestManager = new ScraperTestManager <nhentaiBook>(this);
        }
コード例 #2
0
ファイル: HitomiScraper.cs プロジェクト: t6tg/nhitomi
        public HitomiScraper(IServiceProvider services, IOptionsMonitor <HitomiScraperOptions> options, ILogger <HitomiScraper> logger, IHttpClientFactory http) : base(services, options, logger)
        {
            _http    = http.CreateClient(nameof(HitomiScraper));
            _index   = ActivatorUtilities.CreateInstance <HitomiNozomiIndexReader>(services);
            _options = options;

            _http.DefaultRequestHeaders.TryAddWithoutValidation("Accept", "*/*");
            _http.DefaultRequestHeaders.TryAddWithoutValidation("Accept-Language", "en");
            _http.DefaultRequestHeaders.TryAddWithoutValidation("Referer", "https://hitomi.la");
            _http.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", ScraperAgent.GetUserAgent());

            TestManager = new ScraperTestManager <HitomiBook>(this);
        }