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)
|
if (Download.Selector != null)
|
||||||
{
|
{
|
||||||
|
var selector = applyGoTemplateText(Download.Selector, variables);
|
||||||
var response = await RequestStringWithCookies(link.ToString());
|
var response = await RequestStringWithCookies(link.ToString());
|
||||||
if (response.IsRedirect)
|
if (response.IsRedirect)
|
||||||
response = await RequestStringWithCookies(response.RedirectingTo);
|
response = await RequestStringWithCookies(response.RedirectingTo);
|
||||||
var results = response.Content;
|
var results = response.Content;
|
||||||
var SearchResultParser = new HtmlParser();
|
var SearchResultParser = new HtmlParser();
|
||||||
var SearchResultDocument = SearchResultParser.Parse(results);
|
var SearchResultDocument = SearchResultParser.Parse(results);
|
||||||
var DlUri = SearchResultDocument.QuerySelector(Download.Selector);
|
var DlUri = SearchResultDocument.QuerySelector(selector);
|
||||||
if (DlUri != null)
|
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");
|
var href = DlUri.GetAttribute("href");
|
||||||
href = applyFilters(href, Download.Filters, variables);
|
href = applyFilters(href, Download.Filters, variables);
|
||||||
link = resolvePath(href);
|
link = resolvePath(href);
|
||||||
|
|
Loading…
Reference in New Issue