cardigann: add Boolean usebeforeresponse to downloadblock selectors

this option defaults to false, but if set to true prevents the downloadblock from fetching the details page when processing the selectors for the download.
Instead the response from the beforeblock is used to process the selectors.
#8600
This commit is contained in:
Garfield69
2021-10-06 19:14:34 +13:00
parent 5fa9664097
commit 7235638310
2 changed files with 3 additions and 1 deletions

View File

@@ -1859,7 +1859,8 @@ namespace Jackett.Common.Indexers
try
{
response = await HandleRedirectableRequestAsync(link.ToString(), headers);
if (!selector.Usebeforeresponse || Download.Before == null || response == null)
response = await HandleRedirectableRequestAsync(link.ToString(), headers);
var href = MatchSelector(response, selector, variables, debugMatch: true);
if (href == null)
continue;

View File

@@ -190,6 +190,7 @@ namespace Jackett.Common.Models
{
public string Selector { get; set; }
public string Attribute { get; set; }
public bool Usebeforeresponse { get; set; } = false;
public List<filterBlock> Filters { get; set; }
}
}