From 79fc4850edad5e9f852f916d06be5b3d91197a1a Mon Sep 17 00:00:00 2001 From: CW2aNmYM0ryJ <7yt0lu+28ge3e23j74bk@sharklasers.com> Date: Tue, 13 Jun 2017 14:00:41 +0200 Subject: [PATCH] NCore: Add 2factor support (#1465) --- src/Jackett/Indexers/NCore.cs | 5 +++++ .../Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Jackett/Indexers/NCore.cs b/src/Jackett/Indexers/NCore.cs index bd8feacab..da4d440a6 100644 --- a/src/Jackett/Indexers/NCore.cs +++ b/src/Jackett/Indexers/NCore.cs @@ -99,6 +99,11 @@ namespace Jackett.Indexers { "submit", "Access!" } }; + if (!string.IsNullOrEmpty(configData.TwoFactor.Value)) + { + pairs.Add("2factor", configData.TwoFactor.Value); + } + var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, referer: SiteLink); await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("profile.php"), () => { diff --git a/src/Jackett/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs b/src/Jackett/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs index 886ae4d02..3fe1c1df5 100644 --- a/src/Jackett/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs +++ b/src/Jackett/Models/IndexerConfig/Bespoke/ConfigurationDataNCore.cs @@ -13,6 +13,7 @@ namespace Jackett.Models.IndexerConfig.Bespoke { public StringItem Username { get; private set; } public StringItem Password { get; private set; } + public StringItem TwoFactor { get; private set; } public BoolItem Hungarian { get; set; } public BoolItem English { get; set; } @@ -20,6 +21,7 @@ namespace Jackett.Models.IndexerConfig.Bespoke { Username = new StringItem { Name = "Username", Value = "" }; Password = new StringItem { Name = "Password", Value = "" }; + TwoFactor = new StringItem { Name = "Twofactor", Value = "" }; Hungarian = new BoolItem { Name = "Hungarian", Value = true }; English = new BoolItem { Name = "English", Value = true }; } @@ -40,6 +42,9 @@ namespace Jackett.Models.IndexerConfig.Bespoke case "Password": Password = new StringItem { Name = propertyName, Value = config.value }; break; + case "Twofactor": + TwoFactor = new StringItem { Name = propertyName, Value = config.value }; + break; case "Hungarian": Hungarian = new BoolItem { Name = propertyName, Value = config.value }; break;