Fixed: (RuTracker) Improve the error message for failed logins

pull/1682/head
Bogdan 1 year ago
parent 96234c0fe1
commit aafdefe2f0

@ -104,7 +104,11 @@ namespace NzbDrone.Core.Indexers.Definitions
if (!response.Content.Contains("id=\"logged-in-username\""))
{
throw new IndexerAuthException("RuTracker Auth Failed");
var parser = new HtmlParser();
var document = await parser.ParseDocumentAsync(response.Content);
var errorMessage = document.QuerySelector("h4.warnColor1.tCenter.mrg_16, div.msg-main")?.TextContent.Trim();
throw new IndexerAuthException(errorMessage ?? "RuTracker Auth Failed");
}
cookies = response.GetCookies();

Loading…
Cancel
Save