shazbat: simplify conditions for relogin check (#13993)

This commit is contained in:
Bogdan
2023-02-09 13:54:12 +02:00
committed by GitHub
parent 8572ebf3b6
commit a2729841c0

View File

@@ -269,12 +269,10 @@ namespace Jackett.Common.Indexers
private async Task<WebResult> ReloginIfNecessaryAsync(WebResult response) private async Task<WebResult> ReloginIfNecessaryAsync(WebResult response)
{ {
if (response.ContentString.Contains("onclick=\"document.location='logout'\"") || if (response.ContentString.IndexOf("sign in now", StringComparison.InvariantCultureIgnoreCase) == -1)
response.ContentString.Contains("show_id") || response.ContentString.Contains("Filename") ||
response.ContentString.Contains("Peers") || response.ContentString.Contains("Download"))
return response; return response;
logger.Warn("Session expired. Relogin."); logger.Debug("Session expired. Relogin.");
await ApplyConfiguration(null); await ApplyConfiguration(null);
response.Request.Cookies = CookieHeader; response.Request.Cookies = CookieHeader;