Fixed: Persist Cookies from test on Indexer creation to avoid re-auth

cookie-persist
Qstick 4 years ago
parent c6b6daaf80
commit e43c650d45

@ -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…
Cancel
Save