shizaproject : Fix auth check (#10166) resolves #10160

This commit is contained in:
Dmitry Chepurovskiy
2020-11-10 23:24:56 +03:00
committed by GitHub
parent a45b168785
commit 0a60ab1605

View File

@@ -78,8 +78,7 @@ namespace Jackett.Common.Indexers
await ConfigureIfOK(result.Cookies, IsAuthorized(result), () => await ConfigureIfOK(result.Cookies, IsAuthorized(result), () =>
{ {
const string ErrorSelector = "div.card-content > div.alert-error"; var errorMessage = document.QuerySelector("div.alert-error").Text().Trim();
var errorMessage = document.QuerySelector(ErrorSelector).Text().Trim();
throw new ExceptionWithConfigData(errorMessage, Configuration); throw new ExceptionWithConfigData(errorMessage, Configuration);
}); });
@@ -194,7 +193,7 @@ namespace Jackett.Common.Indexers
private bool IsAuthorized(WebResult result) { private bool IsAuthorized(WebResult result) {
var parser = new HtmlParser(); var parser = new HtmlParser();
var document = parser.ParseDocument(result.ContentString); var document = parser.ParseDocument(result.ContentString);
return document.QuerySelector("div.header-content > div.profile-menu") != null; return document.QuerySelector("div.profile-menu > a").Attributes["href"].Value.EndsWith("/logout");
} }
private static long getReleaseSize(IElement tr) private static long getReleaseSize(IElement tr)