mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -381,7 +381,7 @@ namespace Jackett.Common.Indexers
|
|||||||
return await Download(uncleanLink, RequestType.GET);
|
return await Download(uncleanLink, RequestType.GET);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task<byte[]> Download(Uri link, RequestType method, string refererlink = null, Dictionary<string, string>headers = null)
|
protected async Task<byte[]> Download(Uri link, RequestType method, string referer = null, Dictionary<string, string>headers = null)
|
||||||
{
|
{
|
||||||
// return magnet link
|
// return magnet link
|
||||||
if (link.Scheme == "magnet")
|
if (link.Scheme == "magnet")
|
||||||
@@ -392,7 +392,7 @@ namespace Jackett.Common.Indexers
|
|||||||
.Replace("(", "%28")
|
.Replace("(", "%28")
|
||||||
.Replace(")", "%29")
|
.Replace(")", "%29")
|
||||||
.Replace("'", "%27");
|
.Replace("'", "%27");
|
||||||
var response = await RequestWithCookiesAndRetryAsync(requestLink, null, method, refererlink, null, headers);
|
var response = await RequestWithCookiesAndRetryAsync(requestLink, null, method, referer, null, headers);
|
||||||
|
|
||||||
if (response.IsRedirect)
|
if (response.IsRedirect)
|
||||||
{
|
{
|
||||||
|
@@ -1777,14 +1777,11 @@ namespace Jackett.Common.Indexers
|
|||||||
var variables = GetBaseTemplateVariables();
|
var variables = GetBaseTemplateVariables();
|
||||||
AddTemplateVariablesFromUri(variables, link, ".DownloadUri");
|
AddTemplateVariablesFromUri(variables, link, ".DownloadUri");
|
||||||
if (Download.Before != null)
|
if (Download.Before != null)
|
||||||
{
|
await handleRequest(Download.Before, variables, link.ToString());
|
||||||
var beforeresult = await handleRequest(Download.Before, variables, link.ToString());
|
|
||||||
}
|
|
||||||
if (Download.Method != null)
|
|
||||||
{
|
|
||||||
if (Download.Method == "post")
|
if (Download.Method == "post")
|
||||||
method = RequestType.POST;
|
method = RequestType.POST;
|
||||||
}
|
|
||||||
if (Download.Selector != null)
|
if (Download.Selector != null)
|
||||||
{
|
{
|
||||||
var selector = applyGoTemplateText(Download.Selector, variables);
|
var selector = applyGoTemplateText(Download.Selector, variables);
|
||||||
@@ -1819,7 +1816,7 @@ namespace Jackett.Common.Indexers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return await base.Download(link, method);
|
return await base.Download(link, method, link.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user