|
|
|
@ -200,6 +200,8 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|
|
|
|
|
|
|
|
|
var request = new IndexerRequest(searchUrl, HttpAccept.Html);
|
|
|
|
|
|
|
|
|
|
request.HttpRequest.Headers.UserAgent = Settings.UserAgent;
|
|
|
|
|
|
|
|
|
|
yield return request;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -349,13 +351,32 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|
|
|
|
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class IPTorrentsSettingsValidator : AbstractValidator<IPTorrentsSettings>
|
|
|
|
|
{
|
|
|
|
|
public IPTorrentsSettingsValidator()
|
|
|
|
|
{
|
|
|
|
|
RuleFor(c => c.UserAgent).NotEmpty();
|
|
|
|
|
RuleFor(c => c.Cookie).NotEmpty();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class IPTorrentsSettings : CookieTorrentBaseSettings
|
|
|
|
|
{
|
|
|
|
|
public IPTorrentsSettings()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static readonly IPTorrentsSettingsValidator Validator = new IPTorrentsSettingsValidator();
|
|
|
|
|
|
|
|
|
|
[FieldDefinition(2, Label = "Cookie User-Agent", Type = FieldType.Textbox, HelpText = "User-Agent associated with cookie used from Browser")]
|
|
|
|
|
public string UserAgent { get; set; }
|
|
|
|
|
|
|
|
|
|
[FieldDefinition(3, Label = "FreeLeech Only", Type = FieldType.Checkbox, Advanced = true, HelpText = "Search Freeleech torrents only")]
|
|
|
|
|
public bool FreeLeechOnly { get; set; }
|
|
|
|
|
|
|
|
|
|
public override NzbDroneValidationResult Validate()
|
|
|
|
|
{
|
|
|
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|