mirror of
https://github.com/Jackett/Jackett
synced 2025-02-24 07:10:44 +00:00
NCore: Add 2factor support (#1465)
This commit is contained in:
parent
7cf24e906a
commit
79fc4850ed
2 changed files with 10 additions and 0 deletions
|
@ -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"), () =>
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue