mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-04-18 19:15:10 -04:00
Fixed: Persist Cookies from test on Indexer creation to avoid re-auth
This commit is contained in:
parent
c6b6daaf80
commit
e43c650d45
4 changed files with 20 additions and 1 deletions
|
@ -223,6 +223,11 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||
}
|
||||
}
|
||||
|
||||
public override IDictionary<string, string> GrabCookies()
|
||||
{
|
||||
return ((CardigannRequestGenerator)GetRequestGenerator()).Cookies;
|
||||
}
|
||||
|
||||
public override object RequestAction(string action, IDictionary<string, string> query)
|
||||
{
|
||||
if (action == "checkCaptcha")
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
|
@ -28,6 +29,8 @@ namespace NzbDrone.Core.Indexers
|
|||
|
||||
Task<byte[]> Download(Uri link);
|
||||
|
||||
IDictionary<string, string> GrabCookies();
|
||||
|
||||
IndexerCapabilities GetCapabilities();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,5 +125,10 @@ namespace NzbDrone.Core.Indexers
|
|||
{
|
||||
return Definition.Name;
|
||||
}
|
||||
|
||||
public virtual IDictionary<string, string> GrabCookies()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,7 +267,13 @@ namespace NzbDrone.Core.Indexers
|
|||
MapCardigannDefinition(definition);
|
||||
}
|
||||
|
||||
return base.Create(definition);
|
||||
var newDef = base.Create(definition);
|
||||
|
||||
provider.Definition = newDef;
|
||||
|
||||
_indexerStatusService.UpdateCookies(newDef.Id, provider.GrabCookies(), DateTime.Now + TimeSpan.FromDays(30));
|
||||
|
||||
return newDef;
|
||||
}
|
||||
|
||||
public override void Update(IndexerDefinition definition)
|
||||
|
|
Loading…
Add table
Reference in a new issue