Esempio n. 1
0
        public ReadMangaParser(
            ILogger <ReadMangaParser> logger,
            IMultiton <string, HttpClient> httpClientFactory)
        {
            _logger = logger;
            _client = httpClientFactory.GetInstance(BaseUrl);

            _genresUrl       = $"{BaseUrl}/list/genres/sort_name";
            _mangaUrl        = $"{BaseUrl}/{{0}}";
            _mangaChapterUrl = $"{BaseUrl}/{{0}}/{{1}}/{{2}}?mtr=1";
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MangaFoxParser" /> class.
        /// </summary>
        /// <param name="logger">Instance of <see cref="ILogger{TCategoryName}"/>.</param>
        /// <param name="httpClientFactory">Instance of <see cref="IMultiton{TKey,TValue}"/>.</param>
        public MangaFoxParser(
            ILogger <MangaFoxParser> logger,
            IMultiton <string, HttpClient> httpClientFactory)
        {
            _logger = logger;
            _client = httpClientFactory.GetInstance(BaseUrl);

            if (!_client.DefaultRequestHeaders.Contains("Cookie"))
            {
                _client.DefaultRequestHeaders.TryAddWithoutValidation("Cookie", $"isAdult=1;");
            }

            _genresUrl       = $"{BaseUrl}/directory/";
            _mangaUrl        = $"{BaseUrl}/manga/{{0}}";
            _mangaChapterUrl = $"{BaseUrl}/manga/{{0}}{{1}}{{2}}{{3}}";
        }