cardigann: add var substitution to the search block selector statement.

This commit is contained in:
Garfield69
2021-10-04 10:49:43 +13:00
parent 795ca74df7
commit bd8c0bfafe

View File

@@ -1141,14 +1141,15 @@ namespace Jackett.Common.Indexers
if (Selector.Selector != null) if (Selector.Selector != null)
{ {
if (Dom.Matches(Selector.Selector)) var selector_Selector = applyGoTemplateText(Selector.Selector, variables);
if (Dom.Matches(selector_Selector))
selection = Dom; selection = Dom;
else else
selection = QuerySelector(Dom, Selector.Selector); selection = QuerySelector(Dom, selector_Selector);
if (selection == null) if (selection == null)
{ {
if (required) if (required)
throw new Exception(string.Format("Selector \"{0}\" didn't match {1}", Selector.Selector, Dom.ToHtmlPretty())); throw new Exception(string.Format("Selector \"{0}\" didn't match {1}", selector_Selector, Dom.ToHtmlPretty()));
return null; return null;
} }
} }