diff --git a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs index 4e38db1dc..173c5d7fb 100644 --- a/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs +++ b/src/Jackett.Common/Indexers/Abstract/GazelleTracker.cs @@ -24,7 +24,7 @@ namespace Jackett.Common.Indexers.Abstract { protected virtual string LoginUrl => SiteLink + "login.php"; protected virtual string APIUrl => SiteLink + "ajax.php"; - protected virtual string DownloadUrl => SiteLink + "torrents.php?action=download&usetoken=" + (useTokens ? "1" : "0") + "&id="; + protected virtual string DownloadUrl => SiteLink + "torrents.php?action=download&usetoken=" + (useTokens ? "1" : "0") + (usePassKey ? "&torrent_pass=" + configData.PassKey.Value : "") + "&id="; protected virtual string DetailsUrl => SiteLink + "torrents.php?torrentid="; protected bool useTokens; @@ -32,6 +32,7 @@ namespace Jackett.Common.Indexers.Abstract private readonly bool imdbInTags; private readonly bool useApiKey; + private readonly bool usePassKey; private new ConfigurationDataGazelleTracker configData => (ConfigurationDataGazelleTracker)base.configData; @@ -39,7 +40,7 @@ namespace Jackett.Common.Indexers.Abstract IIndexerConfigurationService configService, WebClient client, Logger logger, IProtectionService p, ICacheService cs, TorznabCapabilities caps, bool supportsFreeleechTokens, bool imdbInTags = false, bool has2Fa = false, - bool useApiKey = false, string instructionMessageOptional = null) + bool useApiKey = false, bool usePassKey = false, string instructionMessageOptional = null) : base(id: id, name: name, description: description, @@ -51,12 +52,13 @@ namespace Jackett.Common.Indexers.Abstract p: p, cacheService: cs, configData: new ConfigurationDataGazelleTracker( - has2Fa, supportsFreeleechTokens, useApiKey, instructionMessageOptional)) + has2Fa, supportsFreeleechTokens, useApiKey, usePassKey, instructionMessageOptional)) { Encoding = Encoding.UTF8; this.imdbInTags = imdbInTags; this.useApiKey = useApiKey; + this.usePassKey = usePassKey; } public override void LoadValuesFromJson(JToken jsonConfig, bool useProtectionService = false) diff --git a/src/Jackett.Common/Indexers/Orpheus.cs b/src/Jackett.Common/Indexers/Orpheus.cs index 52affe4f0..f9347ff0c 100644 --- a/src/Jackett.Common/Indexers/Orpheus.cs +++ b/src/Jackett.Common/Indexers/Orpheus.cs @@ -42,7 +42,8 @@ namespace Jackett.Common.Indexers p: ps, cs: cs, supportsFreeleechTokens: true, - has2Fa: true) + has2Fa: true, + usePassKey: true) { Language = "en-us"; Type = "private"; diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataGazelleTracker.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataGazelleTracker.cs index 73563ac2c..5e0b6273b 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataGazelleTracker.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataGazelleTracker.cs @@ -8,13 +8,15 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke public StringConfigurationItem Username { get; private set; } public PasswordConfigurationItem Password { get; private set; } public StringConfigurationItem ApiKey { get; private set; } + public StringConfigurationItem PassKey { get; private set; } public DisplayInfoConfigurationItem CookieHint { get; private set; } public StringConfigurationItem CookieItem { get; private set; } public BoolConfigurationItem UseTokenItem { get; private set; } public DisplayInfoConfigurationItem Instructions { get; private set; } public ConfigurationDataGazelleTracker(bool has2Fa = false, bool supportsFreeleechToken = false, - bool useApiKey = false, string instructionMessageOptional = null) + bool useApiKey = false, bool usePassKey = false, + string instructionMessageOptional = null) { if (useApiKey) ApiKey = new StringConfigurationItem("APIKey"); @@ -39,6 +41,9 @@ namespace Jackett.Common.Models.IndexerConfig.Bespoke CookieItem = new StringConfigurationItem("Cookie") { Value = "" }; } + if (usePassKey) + PassKey = new StringConfigurationItem("Passkey"); + if (supportsFreeleechToken) UseTokenItem = new BoolConfigurationItem("Use Freeleech Tokens when Available") { Value = false };