mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Cardigann: apply template engine to download/selector
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user