bakabt: fix login. resolves #9240 (#9687)

This commit is contained in:
seeyabye 2020-10-01 02:37:11 +09:00 committed by GitHub
parent 23e7c9d76a
commit efc7f5659d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,6 @@ using Jackett.Common.Services.Interfaces;
using Jackett.Common.Utils.Clients;
using Newtonsoft.Json.Linq;
using NLog;
using WebRequest = Jackett.Common.Utils.Clients.WebRequest;
namespace Jackett.Common.Indexers
{
@ -81,6 +80,12 @@ namespace Jackett.Common.Indexers
{ "returnto", "/index.php" }
};
var parser = new HtmlParser();
var dom = parser.ParseDocument(loginForm.ContentString);
var loginKey = dom.QuerySelector("input[name=\"loginKey\"]");
if (loginKey !=null )
pairs["loginKey"] = loginKey.GetAttribute("value");
var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginForm.Cookies, true, null, SiteLink);
var responseContent = response.ContentString;
await ConfigureIfOK(response.Cookies, responseContent.Contains(LogoutStr), () =>