mirror of
https://github.com/Jackett/Jackett
synced 2024-12-29 03:06:49 +00:00
rutracker + nnmclub title parsing improvements (#2566)
* newstudio - new ru semi-private tracker rutracker - add series parser rutor - global search without category + series parser * newstudio rus semi-private tracker * 999 -> 99 * remove old definition * - add newstudio tracker to the README - newstudio def: remove reduntal inputs - rutor def: revert setting usage into query * nnm-club: new russian semi-private tracker newstudo: fix quality naming * readme * fix quality naming * seasons parsing fix * fix * follow redirect on torrent file download * nnm-club + rutracker name parsing improvements * rutracker: add strip russian letters option
This commit is contained in:
parent
3ce6296a58
commit
b53a30a267
3 changed files with 33 additions and 5 deletions
|
@ -717,12 +717,14 @@
|
||||||
title:
|
title:
|
||||||
selector: a[href^="viewtopic.php?t="] > b
|
selector: a[href^="viewtopic.php?t="] > b
|
||||||
filters:
|
filters:
|
||||||
|
- name: replace
|
||||||
|
args: ["Кураж-Бамбей", "kurazh"]
|
||||||
|
- name: re_replace
|
||||||
|
args: ["(\\([А-Яа-я\\W]+\\))|(^[А-Яа-я\\W\\d]+\\/ )|([а-яА-Я \\-]+,+)|([а-яА-Я]+)", ""]
|
||||||
- name: re_replace
|
- name: re_replace
|
||||||
args: ["\\b(\\d)\\b", "0$1"]
|
args: ["\\b(\\d)\\b", "0$1"]
|
||||||
- name: re_replace
|
- name: re_replace
|
||||||
args: ["(\\([Сс]езон\\s+(\\d+).+[Сс]ери[ия]\\s+(?:(\\d+-*\\d*).*\\d+)*\\))", "(S$2E$3) RUS"]
|
args: ["(\\([Сс]езон\\s+(\\d+).+[Сс]ери[ия]\\s+(?:(\\d+-*\\d*).*\\d+)*\\))", "(S$2E$3) RUS"]
|
||||||
- name: replace
|
|
||||||
args: ["Кураж-Бамбей", "kurazh"]
|
|
||||||
- name: replace
|
- name: replace
|
||||||
args: ["WEBDLRip", "WEBDL"]
|
args: ["WEBDLRip", "WEBDL"]
|
||||||
- name: replace
|
- name: replace
|
||||||
|
|
|
@ -12,6 +12,7 @@ using Jackett.Utils.Clients;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Jackett.Models.IndexerConfig.Bespoke;
|
||||||
|
|
||||||
namespace Jackett.Indexers
|
namespace Jackett.Indexers
|
||||||
{
|
{
|
||||||
|
@ -25,9 +26,9 @@ namespace Jackett.Indexers
|
||||||
protected string cap_sid = null;
|
protected string cap_sid = null;
|
||||||
protected string cap_code_field = 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; }
|
set { base.configData = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ namespace Jackett.Indexers
|
||||||
client: wc,
|
client: wc,
|
||||||
logger: l,
|
logger: l,
|
||||||
p: ps,
|
p: ps,
|
||||||
configData: new ConfigurationDataCaptchaLogin())
|
configData: new ConfigurationDataRutracker())
|
||||||
{
|
{
|
||||||
Encoding = Encoding.GetEncoding("windows-1251");
|
Encoding = Encoding.GetEncoding("windows-1251");
|
||||||
Language = "ru-ru";
|
Language = "ru-ru";
|
||||||
|
@ -1587,6 +1588,11 @@ namespace Jackett.Indexers
|
||||||
|
|
||||||
release.Title = title;
|
release.Title = title;
|
||||||
}
|
}
|
||||||
|
else if (configData.StripRussianLetters.Value)
|
||||||
|
{
|
||||||
|
var regex = new Regex(@"(\([А-Яа-я\W]+\))|(^[А-Яа-я\W\d]+\/ )|([а-яА-Я \-]+,+)|([а-яА-Я]+)");
|
||||||
|
release.Title = regex.Replace(release.Title, "");
|
||||||
|
}
|
||||||
|
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue