mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-27 15:20:50 +02:00
Fixed: (Cardigann) add headers from search block for all downloads
based on jackett c567f47ad1
This commit is contained in:
parent
89a1b0f534
commit
39fd9bea89
1 changed files with 5 additions and 5 deletions
|
|
@ -714,6 +714,7 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
{
|
||||
Cookies = GetCookies();
|
||||
var method = HttpMethod.GET;
|
||||
var headers = new Dictionary<string, string>();
|
||||
|
||||
if (_definition.Download != null)
|
||||
{
|
||||
|
|
@ -722,7 +723,7 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
|
||||
AddTemplateVariablesFromUri(variables, link, ".DownloadUri");
|
||||
|
||||
var headers = ParseCustomHeaders(_definition.Search?.Headers, variables);
|
||||
headers = ParseCustomHeaders(_definition.Search?.Headers, variables);
|
||||
HttpResponse response = null;
|
||||
|
||||
var request = new HttpRequestBuilder(link.ToString())
|
||||
|
|
@ -753,8 +754,6 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
{
|
||||
try
|
||||
{
|
||||
headers = ParseCustomHeaders(_definition.Search?.Headers, variables);
|
||||
|
||||
if (!download.Infohash.UseBeforeResponse || download.Before == null || response == null)
|
||||
{
|
||||
response = await HttpClient.ExecuteProxiedAsync(request, Definition);
|
||||
|
|
@ -777,6 +776,7 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
|
||||
var hashDownloadRequest = new HttpRequestBuilder(torrentLink.AbsoluteUri)
|
||||
.SetCookies(Cookies ?? new Dictionary<string, string>())
|
||||
.SetHeaders(headers ?? new Dictionary<string, string>())
|
||||
.Build();
|
||||
|
||||
hashDownloadRequest.Method = method;
|
||||
|
|
@ -793,8 +793,6 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
}
|
||||
else if (download.Selectors != null)
|
||||
{
|
||||
headers = ParseCustomHeaders(_definition.Search?.Headers, variables);
|
||||
|
||||
foreach (var selector in download.Selectors)
|
||||
{
|
||||
var queryselector = ApplyGoTemplateText(selector.Selector, variables);
|
||||
|
|
@ -836,6 +834,7 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
|
||||
var selectorDownloadRequest = new HttpRequestBuilder(link.AbsoluteUri)
|
||||
.SetCookies(Cookies ?? new Dictionary<string, string>())
|
||||
.SetHeaders(headers ?? new Dictionary<string, string>())
|
||||
.Build();
|
||||
|
||||
selectorDownloadRequest.Method = method;
|
||||
|
|
@ -854,6 +853,7 @@ public async Task<HttpRequest> DownloadRequest(Uri link)
|
|||
|
||||
var downloadRequest = new HttpRequestBuilder(link.AbsoluteUri)
|
||||
.SetCookies(Cookies ?? new Dictionary<string, string>())
|
||||
.SetHeaders(headers ?? new Dictionary<string, string>())
|
||||
.Build();
|
||||
|
||||
downloadRequest.Method = method;
|
||||
|
|
|
|||
Loading…
Reference in a new issue