1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-03-04 02:38:08 +00:00

gazelle: avoid re-logins when using cookies auth method

Fixes #15623
This commit is contained in:
Bogdan 2024-10-04 15:21:14 +03:00
parent 1ab7467621
commit 59f29abfc4

View file

@ -250,8 +250,9 @@ namespace Jackett.Common.Indexers.Definitions.Abstract
var headers = apiKey != null ? new Dictionary<string, string> { [AuthorizationName] = string.Format(AuthorizationFormat, apiKey.Value) } : null;
var response = await RequestWithCookiesAndRetryAsync(searchUrl, headers: headers);
// we get a redirect in html pages and an error message in json response (api)
if (response.IsRedirect && !useApiKey)
if (response.IsRedirect && !useApiKey && configData.CookieItem.Value.IsNullOrWhiteSpace())
{
// re-login only if API key is not in use.
await ApplyConfiguration(null);