partis: Fix login check (#12573) resolves #12558

This commit is contained in:
mjazbc 2021-11-17 03:47:48 +01:00 committed by GitHub
parent 2b1f138d6f
commit b7bfa2baad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -132,11 +132,9 @@ namespace Jackett.Common.Indexers
};
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, string.Empty, false, null, null, true);
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains("/user/logout"), () =>
await ConfigureIfOK(result.Cookies, result.ContentString != null && result.Cookies.Contains("udata"), () =>
{
var parser = new HtmlParser();
var dom = parser.ParseDocument(result.ContentString);
var errorMessage = dom.QuerySelector("#errLogin").TextContent.Trim(); // Prijava ni uspela! obvestilo
var errorMessage = "Login failed. Invalid username or password.";
throw new ExceptionWithConfigData(errorMessage, configData);
});
return IndexerConfigurationStatus.RequiresTesting;