|
|
@ -409,6 +409,19 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
return Task.CompletedTask;
|
|
|
|
return Task.CompletedTask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void ModifyRequest(IndexerRequest request)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
request.HttpRequest.Cookies.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Cookies != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var cookie in Cookies)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
request.HttpRequest.Cookies.Add(cookie.Key, cookie.Value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual async Task<IndexerResponse> FetchIndexerResponse(IndexerRequest request)
|
|
|
|
protected virtual async Task<IndexerResponse> FetchIndexerResponse(IndexerRequest request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.Debug("Downloading Feed " + request.HttpRequest.ToString(false));
|
|
|
|
_logger.Debug("Downloading Feed " + request.HttpRequest.ToString(false));
|
|
|
@ -448,15 +461,8 @@ namespace NzbDrone.Core.Indexers
|
|
|
|
_logger.Trace("Attempting to re-auth based on indexer search response");
|
|
|
|
_logger.Trace("Attempting to re-auth based on indexer search response");
|
|
|
|
|
|
|
|
|
|
|
|
await DoLogin();
|
|
|
|
await DoLogin();
|
|
|
|
request.HttpRequest.Cookies.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Cookies != null)
|
|
|
|
ModifyRequest(request);
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var cookie in Cookies)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
request.HttpRequest.Cookies.Add(cookie.Key, cookie.Value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
response = await _httpClient.ExecuteAsync(request.HttpRequest);
|
|
|
|
response = await _httpClient.ExecuteAsync(request.HttpRequest);
|
|
|
|
}
|
|
|
|
}
|
|
|
|