diff --git a/src/Jackett.Common/Definitions/nnm-club.yml b/src/Jackett.Common/Definitions/nnm-club.yml index 75bce8381..3a4fbe1e4 100644 --- a/src/Jackett.Common/Definitions/nnm-club.yml +++ b/src/Jackett.Common/Definitions/nnm-club.yml @@ -717,12 +717,14 @@ title: selector: a[href^="viewtopic.php?t="] > b filters: + - name: replace + args: ["Кураж-Бамбей", "kurazh"] + - name: re_replace + args: ["(\\([А-Яа-я\\W]+\\))|(^[А-Яа-я\\W\\d]+\\/ )|([а-яА-Я \\-]+,+)|([а-яА-Я]+)", ""] - name: re_replace args: ["\\b(\\d)\\b", "0$1"] - name: re_replace args: ["(\\([Сс]езон\\s+(\\d+).+[Сс]ери[ия]\\s+(?:(\\d+-*\\d*).*\\d+)*\\))", "(S$2E$3) RUS"] - - name: replace - args: ["Кураж-Бамбей", "kurazh"] - name: replace args: ["WEBDLRip", "WEBDL"] - name: replace diff --git a/src/Jackett.Common/Indexers/rutracker.cs b/src/Jackett.Common/Indexers/rutracker.cs index d661d130f..5c889a9cf 100644 --- a/src/Jackett.Common/Indexers/rutracker.cs +++ b/src/Jackett.Common/Indexers/rutracker.cs @@ -12,6 +12,7 @@ using Jackett.Utils.Clients; using Newtonsoft.Json.Linq; using NLog; using System.Text.RegularExpressions; +using Jackett.Models.IndexerConfig.Bespoke; namespace Jackett.Indexers { @@ -25,9 +26,9 @@ namespace Jackett.Indexers protected string cap_sid = null; protected string cap_code_field = null; - private new ConfigurationDataCaptchaLogin configData + private new ConfigurationDataRutracker configData { - get { return (ConfigurationDataCaptchaLogin)base.configData; } + get { return (ConfigurationDataRutracker)base.configData; } set { base.configData = value; } } @@ -40,7 +41,7 @@ namespace Jackett.Indexers client: wc, logger: l, p: ps, - configData: new ConfigurationDataCaptchaLogin()) + configData: new ConfigurationDataRutracker()) { Encoding = Encoding.GetEncoding("windows-1251"); Language = "ru-ru"; @@ -1587,6 +1588,11 @@ namespace Jackett.Indexers release.Title = title; } + else if (configData.StripRussianLetters.Value) + { + var regex = new Regex(@"(\([А-Яа-я\W]+\))|(^[А-Яа-я\W\d]+\/ )|([а-яА-Я \-]+,+)|([а-яА-Я]+)"); + release.Title = regex.Replace(release.Title, ""); + } releases.Add(release); } diff --git a/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs new file mode 100644 index 000000000..8e21e501e --- /dev/null +++ b/src/Jackett.Common/Models/IndexerConfig/Bespoke/ConfigurationDataRutracker.cs @@ -0,0 +1,20 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.IndexerConfig.Bespoke +{ + class ConfigurationDataRutracker : ConfigurationDataCaptchaLogin + { + public BoolItem StripRussianLetters { get; private set; } + + public ConfigurationDataRutracker() + : base() + { + StripRussianLetters = new BoolItem() { Name = "Strip Russian Letters", Value = true }; + } + } +}