mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-24 05:47:22 -04:00
Fixed: (Anthelion) Null BaseUrl and better error message on auth fail
Fixes #295
This commit is contained in:
parent
889591d0b1
commit
e45f88473c
1 changed files with 7 additions and 8 deletions
|
@ -79,9 +79,13 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
|
||||
var response = await ExecuteAuth(authLoginRequest);
|
||||
|
||||
if (!response.Content.Contains("logout.php"))
|
||||
if (CheckIfLoginNeeded(response))
|
||||
{
|
||||
throw new IndexerAuthException("Anthelion Auth Failed");
|
||||
var parser = new HtmlParser();
|
||||
var dom = parser.ParseDocument(response.Content);
|
||||
var errorMessage = dom.QuerySelector("form#loginform").TextContent.Trim();
|
||||
|
||||
throw new IndexerAuthException(errorMessage);
|
||||
}
|
||||
|
||||
cookies = response.GetCookies();
|
||||
|
@ -127,7 +131,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
{
|
||||
public AnthelionSettings Settings { get; set; }
|
||||
public IndexerCapabilities Capabilities { get; set; }
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
public AnthelionRequestGenerator()
|
||||
{
|
||||
|
@ -135,7 +138,7 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
|
||||
private IEnumerable<IndexerRequest> GetPagedRequests(string term, int[] categories, string imdbId = null)
|
||||
{
|
||||
var searchUrl = string.Format("{0}/torrents.php", BaseUrl.TrimEnd('/'));
|
||||
var searchUrl = string.Format("{0}/torrents.php", Settings.BaseUrl.TrimEnd('/'));
|
||||
|
||||
// TODO: IMDB search is available but it requires to parse the details page
|
||||
var qc = new NameValueCollection
|
||||
|
@ -174,8 +177,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SanitizedSearchTerm), searchCriteria.Categories));
|
||||
|
||||
return pageableRequests;
|
||||
}
|
||||
|
||||
|
@ -192,8 +193,6 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
pageableRequests.Add(GetPagedRequests(string.Format("{0}", searchCriteria.SanitizedSearchTerm), searchCriteria.Categories));
|
||||
|
||||
return pageableRequests;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue