mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 13:01:28 +02:00
@@ -113,7 +113,7 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
|
|||||||
|
|
||||||
var url = request.Url.ToString();
|
var url = request.Url.ToString();
|
||||||
var userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36";
|
var userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36";
|
||||||
var maxTimeout = 60000;
|
var maxTimeout = Settings.RequestTimeout * 1000;
|
||||||
|
|
||||||
if (request.Method == HttpMethod.GET)
|
if (request.Method == HttpMethod.GET)
|
||||||
{
|
{
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
using NLog.Config;
|
||||||
using NzbDrone.Core.Annotations;
|
using NzbDrone.Core.Annotations;
|
||||||
using NzbDrone.Core.Validation;
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
|
|||||||
public FlareSolverrSettingsValidator()
|
public FlareSolverrSettingsValidator()
|
||||||
{
|
{
|
||||||
RuleFor(c => c.Host).NotEmpty();
|
RuleFor(c => c.Host).NotEmpty();
|
||||||
|
RuleFor(c => c.RequestTimeout).InclusiveBetween(1, 180);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,11 +21,15 @@ namespace NzbDrone.Core.IndexerProxies.FlareSolverr
|
|||||||
public FlareSolverrSettings()
|
public FlareSolverrSettings()
|
||||||
{
|
{
|
||||||
Host = "http://localhost:8191/";
|
Host = "http://localhost:8191/";
|
||||||
|
RequestTimeout = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
[FieldDefinition(0, Label = "Host")]
|
[FieldDefinition(0, Label = "Host")]
|
||||||
public string Host { get; set; }
|
public string Host { get; set; }
|
||||||
|
|
||||||
|
[FieldDefinition(2, Label = "Request Timeout", Advanced = true, HelpText = "FlareSolverr maxTimeout Request Parameter", Unit = "seconds")]
|
||||||
|
public int RequestTimeout { get; set; }
|
||||||
|
|
||||||
public NzbDroneValidationResult Validate()
|
public NzbDroneValidationResult Validate()
|
||||||
{
|
{
|
||||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||||
|
Reference in New Issue
Block a user