From d4453a440e624fbe54b2e543b30f2673991a9872 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Thu, 2 Feb 2017 18:04:25 +0100 Subject: [PATCH] Add CGPeers tracker --- .../Indexers/Abstract/GazelleTracker.cs | 2 +- src/Jackett/Indexers/cgpeers.cs | 33 +++++++++++++++++++ src/Jackett/Jackett.csproj | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/Jackett/Indexers/cgpeers.cs diff --git a/src/Jackett/Indexers/Abstract/GazelleTracker.cs b/src/Jackett/Indexers/Abstract/GazelleTracker.cs index 95b2c02b2..1ec649b8c 100644 --- a/src/Jackett/Indexers/Abstract/GazelleTracker.cs +++ b/src/Jackett/Indexers/Abstract/GazelleTracker.cs @@ -216,7 +216,7 @@ namespace Jackett.Indexers.Abstract release.Guid = release.Comments; release.Link = new Uri(DownloadUrl + torrentId); var category = (string)torrent["category"]; - if (category == null) + if (category == null || category.Contains("Select Category")) release.Category = MapTrackerCatToNewznab("1"); else release.Category = MapTrackerCatDescToNewznab(category); diff --git a/src/Jackett/Indexers/cgpeers.cs b/src/Jackett/Indexers/cgpeers.cs new file mode 100644 index 000000000..84615c4e3 --- /dev/null +++ b/src/Jackett/Indexers/cgpeers.cs @@ -0,0 +1,33 @@ +using Jackett.Models; +using NLog; +using Jackett.Services; +using Jackett.Utils.Clients; +using Jackett.Indexers.Abstract; + +namespace Jackett.Indexers +{ + public class CGPeers : GazelleTracker, IIndexer + { + public CGPeers(IIndexerManagerService indexerManager, IWebClient webClient, Logger logger, IProtectionService protectionService) + : base(name: "CGPeers", + desc: null, + link: "https://www.cgpeers.com/", + indexerManager: indexerManager, + logger: logger, + protectionService: protectionService, + webClient: webClient + ) + { + Language = "en-us"; + Type = "private"; + + AddCategoryMapping(1, TorznabCatType.PCISO, "Full Applications"); + AddCategoryMapping(2, TorznabCatType.PC0day, "Plugins"); + AddCategoryMapping(3, TorznabCatType.Other, "Tutorials"); + AddCategoryMapping(4, TorznabCatType.Other, "Models"); + AddCategoryMapping(5, TorznabCatType.Other, "Materials"); + AddCategoryMapping(6, TorznabCatType.OtherMisc, "Misc"); + AddCategoryMapping(7, TorznabCatType.Other, "GameDev"); + } + } +} \ No newline at end of file diff --git a/src/Jackett/Jackett.csproj b/src/Jackett/Jackett.csproj index 55fd6c6e9..332dbd04a 100644 --- a/src/Jackett/Jackett.csproj +++ b/src/Jackett/Jackett.csproj @@ -179,6 +179,7 @@ +