elite-tracker: add multi config option. resolves #5064

add cat 97
fix category selector
fix longtitle processing
This commit is contained in:
Garfield69
2019-12-23 10:01:32 +13:00
parent cf1f70d581
commit e85ffec947
2 changed files with 17 additions and 8 deletions

View File

@@ -24,8 +24,9 @@ namespace Jackett.Common.Indexers
private string BrowseUrl
{ get { return SiteLink + "browse.php"; } }
private bool TorrentHTTPSMode => configData.TorrentHTTPSMode.Value;
private string ReplaceMulti => configData.ReplaceMulti.Value;
private new ConfigurationDataEliteTracker configData
{
get { return (ConfigurationDataEliteTracker)base.configData; }
set { base.configData = value; }
@@ -35,6 +36,7 @@ namespace Jackett.Common.Indexers
: base(name: "Elite-Tracker",
description: "French Torrent Tracker",
link: "https://elite-tracker.net/",
caps: new TorznabCapabilities(),
configService: configService,
logger: logger,
p: protectionService,
@@ -46,6 +48,9 @@ namespace Jackett.Common.Indexers
Language = "fr-fr";
Type = "private";
// Clean capabilities
TorznabCaps.Categories.Clear();
AddCategoryMapping(27, TorznabCatType.TVAnime, "Animation/Animes");
AddCategoryMapping(63, TorznabCatType.TVAnime, "Animes DVD");
AddCategoryMapping(56, TorznabCatType.TVAnime, "Animes HD");
@@ -63,6 +68,7 @@ namespace Jackett.Common.Indexers
AddCategoryMapping(4, TorznabCatType.PC0day, "WINDOWS");
AddCategoryMapping(38, TorznabCatType.TVDocumentary, "DOCUMENTAIRES");
AddCategoryMapping(97, TorznabCatType.TVDocumentary, "DOCUMENTAIRES PACK");
AddCategoryMapping(34, TorznabCatType.Books, "EBOOKS");
AddCategoryMapping(86, TorznabCatType.Books, "ABOOKS");
@@ -206,8 +212,8 @@ namespace Jackett.Common.Indexers
var Seeders = Row.QuerySelector("td:nth-child(7)").QuerySelector("a");
var Leechers = Row.QuerySelector("td:nth-child(8)").QuerySelector("a");
var categoryIdparts = category.GetAttribute("href").Split('-');
var categoryId = categoryIdparts[categoryIdparts.Length - 1].Replace(".ts", "");
var categoryId = category.GetAttribute("href").Split('=')[1];
release.Category = MapTrackerCatToNewznab(categoryId);
release.Title = title.TextContent;
release.Category = MapTrackerCatToNewznab(categoryId);
@@ -258,12 +264,11 @@ namespace Jackett.Common.Indexers
release.Description = desc;
}
// if even the tooltip title is shortened we use the URL
if (release.Title.EndsWith("..."))
//issue #5064 replace multi keyword
if (!string.IsNullOrEmpty(ReplaceMulti))
{
var tregex = new Regex(@"/([^/]+)-s-\d+\.ts");
var tmatch = tregex.Match(release.Comments.ToString());
release.Title = tmatch.Groups[1].Value;
System.Text.RegularExpressions.Regex regex = new Regex("(?i)([\\.\\- ])MULTI([\\.\\- ])");
release.Title = regex.Replace(release.Title, "$1" + ReplaceMulti + "$2");
}
if (pretime != null)