immortalseed: don't return the whole page as error (#13961)

This commit is contained in:
Bogdan 2023-02-02 07:08:38 +02:00 committed by GitHub
parent f8a9c57656
commit aac8469ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -133,12 +133,9 @@ namespace Jackett.Common.Indexers
{
var parser = new HtmlParser();
var document = parser.ParseDocument(response.ContentString);
var messageEl = document.QuerySelector("#main table");
var errorMessage = response.ContentString;
if (messageEl != null)
errorMessage = messageEl.TextContent.Trim();
var errorMessage = document.QuerySelector("#main table td:contains(\"ERROR\")")?.TextContent.Trim();
throw new ExceptionWithConfigData(errorMessage, configData);
throw new ExceptionWithConfigData(errorMessage ?? "Login failed.", configData);
});
return IndexerConfigurationStatus.RequiresTesting;