From d6f15940b3102e862b7b9d027b08359fa6057c10 Mon Sep 17 00:00:00 2001 From: Garfield69 Date: Mon, 6 May 2019 09:13:10 +1200 Subject: [PATCH] abnormal: add replace-multi option. #3847 --- src/Jackett.Common/Indexers/Abnormal.cs | 6 ++++++ .../IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Jackett.Common/Indexers/Abnormal.cs b/src/Jackett.Common/Indexers/Abnormal.cs index 858233527..3adf2bef9 100644 --- a/src/Jackett.Common/Indexers/Abnormal.cs +++ b/src/Jackett.Common/Indexers/Abnormal.cs @@ -32,6 +32,7 @@ namespace Jackett.Common.Indexers private string TorrentCommentUrl { get { return TorrentDescriptionUrl; } } private string TorrentDescriptionUrl { get { return SiteLink + "torrents.php?id="; } } private string TorrentDownloadUrl { get { return SiteLink + "torrents.php?action=download&id={id}&authkey={auth_key}&torrent_pass={torrent_pass}"; } } + private string ReplaceMulti { get { return ConfigData.ReplaceMulti.Value; } } private bool Latency { get { return ConfigData.Latency.Value; } } private bool DevMode { get { return ConfigData.DevMode.Value; } } private bool CacheMode { get { return ConfigData.HardDriveCache.Value; } } @@ -302,6 +303,11 @@ namespace Jackett.Common.Indexers // Release Name string name = tRow.Find("td:eq(1) > a").Text(); + //issue #3847 replace multi keyword + if(!string.IsNullOrEmpty(ReplaceMulti)){ + System.Text.RegularExpressions.Regex regex = new Regex("(?i)([\\.\\- ])MULTI([\\.\\- ])"); + name = regex.Replace(name, "$1"+ReplaceMulti+"$2"); + } output("Release: " + name); // Category diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs index 1328364ea..39bd0db17 100644 --- a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataAbnormal.cs @@ -8,6 +8,7 @@ public StringItem Username { get; private set; } public StringItem Password { get; private set; } public DisplayItem PagesWarning { get; private set; } + public StringItem ReplaceMulti { get; private set; } public StringItem Pages { get; private set; } public DisplayItem SecurityWarning { get; private set; } public BoolItem Latency { get; private set; } @@ -34,8 +35,9 @@ CredentialsWarning = new DisplayItem("Credentials Configuration (Private Tracker),

") { Name = "Credentials" }; Username = new StringItem { Name = "Username (Required)", Value = "" }; Password = new StringItem { Name = "Password (Required)", Value = "" }; - PagesWarning = new DisplayItem("Preferences Configuration (Tweak your search settings),

") { Name = "Preferences" }; + PagesWarning = new DisplayItem("Preferences Configuration (Tweak your search settings),

") { Name = "Preferences" }; Pages = new StringItem { Name = "Max Pages to Process (Required)", Value = "4" }; + ReplaceMulti = new StringItem() { Name = "Replace MULTI", Value = "MULTI.FRENCH" }; SecurityWarning = new DisplayItem("Security Configuration (Read this area carefully !),

") { Name = "Security" }; Latency = new BoolItem() { Name = "Latency Simulation (Optional)", Value = false }; Browser = new BoolItem() { Name = "Browser Simulation (Optional)", Value = true };