mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Cardigann: add support for download/filters
This commit is contained in:
@@ -1497,11 +1497,11 @@ namespace Jackett.Indexers
|
||||
if (Definition.Download != null)
|
||||
{
|
||||
var Download = Definition.Download;
|
||||
var variables = getTemplateVariablesFromConfigData();
|
||||
AddTemplateVariablesFromUri(variables, link, ".DownloadUri");
|
||||
if (Download.Before != null)
|
||||
{
|
||||
var beforeVariables = getTemplateVariablesFromConfigData();
|
||||
AddTemplateVariablesFromUri(beforeVariables, link, ".DownloadUri");
|
||||
var beforeresult = await handleRequest(Download.Before, beforeVariables, link.ToString());
|
||||
var beforeresult = await handleRequest(Download.Before, variables, link.ToString());
|
||||
}
|
||||
if (Download.Method != null)
|
||||
{
|
||||
@@ -1521,6 +1521,7 @@ namespace Jackett.Indexers
|
||||
{
|
||||
logger.Debug(string.Format("CardigannIndexer ({0}): Download selector {1} matched:{2}", ID, Download.Selector, DlUri.ToHtmlPretty()));
|
||||
var href = DlUri.GetAttribute("href");
|
||||
href = applyFilters(href, Download.Filters, variables);
|
||||
link = resolvePath(href);
|
||||
}
|
||||
else
|
||||
|
@@ -193,6 +193,7 @@ namespace Jackett.Models
|
||||
public class downloadBlock
|
||||
{
|
||||
public string Selector { get; set; }
|
||||
public List<filterBlock> Filters { get; set; }
|
||||
public string Method { get; set; }
|
||||
public requestBlock Before { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user