public ThePirateBaySource(ILogService logger, IThePirateBayParser parser)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _parser = parser ?? throw new ArgumentNullException(nameof(parser));

            _httpClient = new HttpClient
            {
                Timeout = TimeSpan.FromMilliseconds(5000)
            };
            _baseUrl        = ConfigurationManager.AppSettings["ThePirateBayUrl"];
            _searchEndpoint = Path.Combine(_baseUrl, ConfigurationManager.AppSettings["ThePirateBaySearchEndpoint"]);
        }
コード例 #2
0
        public ThePirateBaySource(IThePirateBayParser parser, IConfiguration config)
        {
            _parser = parser ?? throw new ArgumentNullException(nameof(parser));

            _baseUrl = config.GetValue <string>("UrlInfo:ThePirateBayUrl");

            _searchResource = config.GetValue <string>("UrlInfo:ThePirateBaySearchEndpoint");
            _searchEndpoint = Path.Combine(_baseUrl, _searchResource);

            _mirrors = new[]// TODO: FROM CONFIG
            {
                "https://tpb.party/",
                "https://thepiratebay0.org/",
                "https://thepiratebay10.org/",
                "https://piratebay1.live/"
            };
        }
コード例 #3
0
        public ThePirateBaySource(ILogService logger, IThePirateBayParser parser)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _parser = parser ?? throw new ArgumentNullException(nameof(parser));

            _baseUrl = ConfigurationManager.AppSettings["ThePirateBayUrl"];

            _searchResource = ConfigurationManager.AppSettings["ThePirateBaySearchEndpoint"];
            _searchEndpoint = Path.Combine(_baseUrl, _searchResource);

            _mirrors = new[]// TODO: FROM CONFIG
            {
                "https://tpb.party/",
                "https://thepiratebay0.org/",
                "https://thepiratebay10.org/",
                "https://piratebay1.live/"
            };
        }