mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: (Cardigann) Bump minimum version to v10
This commit is contained in:
@@ -29,7 +29,7 @@ namespace NzbDrone.Core.IndexerVersions
|
|||||||
/* Update Service will fall back if version # does not exist for an indexer per Ta */
|
/* Update Service will fall back if version # does not exist for an indexer per Ta */
|
||||||
|
|
||||||
private const string DEFINITION_BRANCH = "master";
|
private const string DEFINITION_BRANCH = "master";
|
||||||
private const int DEFINITION_VERSION = 9;
|
private const int DEFINITION_VERSION = 10;
|
||||||
|
|
||||||
// Used when moving yml to C#
|
// Used when moving yml to C#
|
||||||
private readonly List<string> _definitionBlocklist = new ()
|
private readonly List<string> _definitionBlocklist = new ()
|
||||||
|
@@ -337,9 +337,11 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann
|
|||||||
variables[name] = selected.Key;
|
variables[name] = selected.Key;
|
||||||
break;
|
break;
|
||||||
case "info":
|
case "info":
|
||||||
variables[name] = value;
|
case "info_cookie":
|
||||||
break;
|
case "info_flaresolverr":
|
||||||
|
case "info_useragent":
|
||||||
case "cardigannCaptcha":
|
case "cardigannCaptcha":
|
||||||
|
// no-op
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotSupportedException($"Type {setting.Type} is not supported.");
|
throw new NotSupportedException($"Type {setting.Type} is not supported.");
|
||||||
|
@@ -60,7 +60,7 @@ namespace Prowlarr.Api.V1.Indexers
|
|||||||
|
|
||||||
if (definition.Implementation == nameof(Cardigann))
|
if (definition.Implementation == nameof(Cardigann))
|
||||||
{
|
{
|
||||||
var extraFields = definition.ExtraFields?.Select(MapField).ToList() ?? new List<Field>();
|
var extraFields = definition.ExtraFields?.Select(MapCardigannField).ToList() ?? new List<Field>();
|
||||||
|
|
||||||
resource.Fields.AddRange(extraFields);
|
resource.Fields.AddRange(extraFields);
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ namespace Prowlarr.Api.V1.Indexers
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Field MapField(SettingsField setting, int order)
|
private Field MapCardigannField(SettingsField setting, int order)
|
||||||
{
|
{
|
||||||
var field = new Field
|
var field = new Field
|
||||||
{
|
{
|
||||||
@@ -185,6 +185,26 @@ namespace Prowlarr.Api.V1.Indexers
|
|||||||
{
|
{
|
||||||
field.Value = bool.TryParse(setting.Default, out var value) && value;
|
field.Value = bool.TryParse(setting.Default, out var value) && value;
|
||||||
}
|
}
|
||||||
|
else if (setting.Type is "info_cookie" or "info_flaresolverr" or "info_useragent")
|
||||||
|
{
|
||||||
|
field.Type = "info";
|
||||||
|
|
||||||
|
switch (setting.Type)
|
||||||
|
{
|
||||||
|
case "info_cookie":
|
||||||
|
field.Label = "How to get the Cookie";
|
||||||
|
field.Value = "<ol><li>Login to this tracker with your browser</li><li>Open the <b>DevTools</b> panel by pressing <b>F12</b></li><li>Select the <b>Network</b> tab</li><li>Click on the <b>Doc</b> button (Chrome Browser) or <b>HTML</b> button (FireFox)</li><li>Refresh the page by pressing <b>F5</b></li><li>Click on the first row entry</li><li>Select the <b>Headers</b> tab on the Right panel</li><li>Find <b>'cookie:'</b> in the <b>Request Headers</b> section</li><li><b>Select</b> and <b>Copy</b> the whole cookie string <i>(everything after 'cookie: ')</i> and <b>Paste</b> here.</li></ol>";
|
||||||
|
break;
|
||||||
|
case "info_flaresolverr":
|
||||||
|
field.Label = "FlareSolverr Info";
|
||||||
|
field.Value = "This site may use Cloudflare DDoS Protection, therefore Prowlarr requires <a href=\"https://wiki.servarr.com/prowlarr/faq#can-i-use-flaresolverr-indexers\" target=\"_blank\" rel=\"noreferrer\">FlareSolverr</a> to access it.";
|
||||||
|
break;
|
||||||
|
case "info_useragent":
|
||||||
|
field.Label = "How to get the User-Agent";
|
||||||
|
field.Value = "<ol><li>From the same place you fetched the cookie,</li><li>Find <b>'user-agent:'</b> in the <b>Request Headers</b> section</li><li><b>Select</b> and <b>Copy</b> the whole user-agent string <i>(everything after 'user-agent: ')</i> and <b>Paste</b> here.</li></ol>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
field.Value = setting.Default;
|
field.Value = setting.Default;
|
||||||
|
Reference in New Issue
Block a user