Cardigann: add support for GET login

This commit is contained in:
kaso17
2017-01-06 19:04:26 +01:00
parent c9e5f14687
commit 1134ef71da

View File

@@ -525,6 +525,22 @@ namespace Jackett.Indexers
{ {
configData.CookieHeader.Value = ((StringItem)configData.GetDynamic("cookie")).Value; configData.CookieHeader.Value = ((StringItem)configData.GetDynamic("cookie")).Value;
} }
else if (Login.Method == "get")
{
var queryCollection = new NameValueCollection();
foreach (var Input in Definition.Login.Inputs)
{
var value = applyGoTemplateText(Input.Value);
queryCollection.Add(Input.Key, value);
}
var LoginUrl = resolvePath(Login.Path + "?" + queryCollection.GetQueryString()).ToString();
configData.CookieHeader.Value = null;
var loginResult = await RequestStringWithCookies(LoginUrl, null, SiteLink);
configData.CookieHeader.Value = loginResult.Cookies;
checkForLoginError(loginResult);
}
else else
{ {
throw new NotImplementedException("Login method " + Definition.Login.Method + " not implemented"); throw new NotImplementedException("Login method " + Definition.Login.Method + " not implemented");