From 9060d8accae52fa0a42da60294d6652188137be1 Mon Sep 17 00:00:00 2001 From: IIIspaceIII Date: Sun, 5 Jan 2020 08:12:19 +0200 Subject: [PATCH] filelist: fix login (#6827) resolves #6782 --- src/Jackett.Common/Indexers/FileList.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Jackett.Common/Indexers/FileList.cs b/src/Jackett.Common/Indexers/FileList.cs index 0894c8bae..2bf940ea9 100644 --- a/src/Jackett.Common/Indexers/FileList.cs +++ b/src/Jackett.Common/Indexers/FileList.cs @@ -80,12 +80,16 @@ namespace Jackett.Common.Indexers public override async Task ApplyConfiguration(JToken configJson) { LoadValuesFromJson(configJson); + var responseFirstPage = await RequestStringWithCookiesAndRetry(SiteLink + "login.php?returnto=%2F", "", null); + CQ domFirstPage = responseFirstPage.Content; + var validator = domFirstPage.Find("input[name =\"validator\"]").Attr("value"); var pairs = new Dictionary { + { "validator", validator}, { "username", configData.Username.Value }, { "password", configData.Password.Value } }; - var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, null, LoginUrl); + var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, responseFirstPage.Cookies, true, null, LoginUrl); await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("logout.php"), () => { CQ dom = result.Content;