mirror of https://github.com/Jackett/Jackett
Cardigann: Add support for search/headers
This commit is contained in:
parent
251a631523
commit
aa6e7b148b
|
@ -191,6 +191,7 @@ namespace Jackett.Indexers
|
||||||
{
|
{
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
public List<searchPathBlock> Paths { get; set; }
|
public List<searchPathBlock> Paths { get; set; }
|
||||||
|
public Dictionary<string, List<string>> Headers { get; set; }
|
||||||
public List<filterBlock> Keywordsfilters { get; set; }
|
public List<filterBlock> Keywordsfilters { get; set; }
|
||||||
public Dictionary<string, string> Inputs { get; set; }
|
public Dictionary<string, string> Inputs { get; set; }
|
||||||
public List<errorBlock> Error { get; set; }
|
public List<errorBlock> Error { get; set; }
|
||||||
|
@ -1215,10 +1216,18 @@ namespace Jackett.Indexers
|
||||||
|
|
||||||
// send HTTP request
|
// send HTTP request
|
||||||
WebClientStringResult response = null;
|
WebClientStringResult response = null;
|
||||||
|
Dictionary<string, string> headers = null;
|
||||||
|
if (Search.Headers != null)
|
||||||
|
{
|
||||||
|
// FIXME: fix jackett header handling (allow it to specifiy the same header multipe times)
|
||||||
|
headers = new Dictionary<string, string>();
|
||||||
|
foreach (var header in Search.Headers)
|
||||||
|
headers.Add(header.Key, header.Value[0]);
|
||||||
|
}
|
||||||
if (method == RequestType.POST)
|
if (method == RequestType.POST)
|
||||||
response = await PostDataWithCookies(searchUrl, queryCollection);
|
response = await PostDataWithCookies(searchUrl, queryCollection, null, null, headers);
|
||||||
else
|
else
|
||||||
response = await RequestStringWithCookies(searchUrl);
|
response = await RequestStringWithCookies(searchUrl, null, null, headers);
|
||||||
var results = response.Content;
|
var results = response.Content;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue