Fixed: (Cardigann) Input pairs in HandleRequest should be form data

Should fix some download links not working for Cardigann indexers
pull/387/head
Qstick 3 years ago
parent 0508dd2b66
commit 0d1025d60a

@ -688,13 +688,20 @@ namespace NzbDrone.Core.Indexers.Cardigann
var httpRequest = new HttpRequestBuilder(requestLinkStr) var httpRequest = new HttpRequestBuilder(requestLinkStr)
.SetCookies(Cookies ?? new Dictionary<string, string>()) .SetCookies(Cookies ?? new Dictionary<string, string>())
.SetHeaders(pairs ?? new Dictionary<string, string>()) .SetHeader("Referer", referer);
.SetHeader("Referer", referer)
.Build();
httpRequest.Method = method; httpRequest.Method = method;
var response = await HttpClient.ExecuteAsync(httpRequest); // Add form data for POST requests
if (method == HttpMethod.POST)
{
foreach (var param in pairs)
{
httpRequest.AddFormParameter(param.Key, param.Value);
}
}
var response = await HttpClient.ExecuteAsync(httpRequest.Build());
_logger.Debug($"CardigannIndexer ({_definition.Id}): handleRequest() remote server returned {response.StatusCode.ToString()}"); _logger.Debug($"CardigannIndexer ({_definition.Id}): handleRequest() remote server returned {response.StatusCode.ToString()}");
return response; return response;

Loading…
Cancel
Save