mirror of https://github.com/Jackett/Jackett
Cardigann: apply template engine to download/selector
This commit is contained in:
parent
26258f2768
commit
97a5d58f13
|
@ -1510,16 +1510,17 @@ namespace Jackett.Indexers
|
|||
}
|
||||
if (Download.Selector != null)
|
||||
{
|
||||
var selector = applyGoTemplateText(Download.Selector, variables);
|
||||
var response = await RequestStringWithCookies(link.ToString());
|
||||
if (response.IsRedirect)
|
||||
response = await RequestStringWithCookies(response.RedirectingTo);
|
||||
var results = response.Content;
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.Parse(results);
|
||||
var DlUri = SearchResultDocument.QuerySelector(Download.Selector);
|
||||
var DlUri = SearchResultDocument.QuerySelector(selector);
|
||||
if (DlUri != null)
|
||||
{
|
||||
logger.Debug(string.Format("CardigannIndexer ({0}): Download selector {1} matched:{2}", ID, Download.Selector, DlUri.ToHtmlPretty()));
|
||||
logger.Debug(string.Format("CardigannIndexer ({0}): Download selector {1} matched:{2}", ID, selector, DlUri.ToHtmlPretty()));
|
||||
var href = DlUri.GetAttribute("href");
|
||||
href = applyFilters(href, Download.Filters, variables);
|
||||
link = resolvePath(href);
|
||||
|
|
Loading…
Reference in New Issue