|
|
@ -116,19 +116,16 @@ namespace NzbDrone.Core.Indexers.Gazelle
|
|
|
|
var response = HttpClient.Execute(authLoginRequest);
|
|
|
|
var response = HttpClient.Execute(authLoginRequest);
|
|
|
|
|
|
|
|
|
|
|
|
cookies = response.GetCookies();
|
|
|
|
cookies = response.GetCookies();
|
|
|
|
AuthCookieCache.Set(authKey, cookies, new TimeSpan(7, 0, 0, 0, 0)); // re-auth every 7 days
|
|
|
|
|
|
|
|
requestBuilder.SetCookies(cookies);
|
|
|
|
AuthCookieCache.Set(authKey, cookies);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
requestBuilder.SetCookies(cookies);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var index = GetIndex(cookies);
|
|
|
|
var index = GetIndex(cookies);
|
|
|
|
|
|
|
|
|
|
|
|
if (index.Status.IsNullOrWhiteSpace() || index.Status != "success")
|
|
|
|
if (index == null || index.Status.IsNullOrWhiteSpace() || index.Status != "success")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Logger.Debug("Gazelle authentication failed.");
|
|
|
|
Logger.Debug("Gazelle authentication failed.");
|
|
|
|
|
|
|
|
AuthCookieCache.Remove(authKey);
|
|
|
|
throw new Exception("Failed to authenticate with Gazelle.");
|
|
|
|
throw new Exception("Failed to authenticate with Gazelle.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|