diff --git a/README.md b/README.md index 43c5fc922..014164ee5 100644 --- a/README.md +++ b/README.md @@ -500,7 +500,7 @@ A third-party Golang SDK for Jackett is available from [webtor-io/go-jackett](ht * SceneRush * SceneTime * SDBits [![(invite needed)][inviteneeded]](#) - * Seals + * GreatPosterWall (GPW) * Secret Cinema * SeedFile (SF) * Shareisland diff --git a/src/Jackett.Common/Indexers/GreatPosterWall.cs b/src/Jackett.Common/Indexers/GreatPosterWall.cs new file mode 100644 index 000000000..94b0548d8 --- /dev/null +++ b/src/Jackett.Common/Indexers/GreatPosterWall.cs @@ -0,0 +1,141 @@ +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Jackett.Common.Indexers.Abstract; +using Jackett.Common.Models; +using Jackett.Common.Services.Interfaces; +using Jackett.Common.Utils; +using Newtonsoft.Json.Linq; +using NLog; +using WebClient = Jackett.Common.Utils.Clients.WebClient; + +namespace Jackett.Common.Indexers +{ + [ExcludeFromCodeCoverage] + public class GreatPosterWall : GazelleTracker + { + public GreatPosterWall(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps, + ICacheService cs) + : base(id: "greatposterwall", + name: "GreatPosterWall", + description: "GreatPosterWall (GPW) is a CHINESE Private site for MOVIES", + link: "https://greatposterwall.com/", + caps: new TorznabCapabilities + { + MovieSearchParams = new List + { + MovieSearchParam.Q, MovieSearchParam.ImdbId + } + }, + configService: configService, + client: wc, + logger: l, + p: ps, + cs: cs, + supportsFreeleechTokens: true, + imdbInTags: false, + has2Fa: true, + useApiKey: false, + usePassKey: false, + instructionMessageOptional: null + ) + { + Language = "zh-CN"; + Type = "private"; + + AddCategoryMapping(1, TorznabCatType.Movies, "Movies 电影"); + } + + protected override async Task> PerformQuery(TorznabQuery query) + { + // GPW uses imdbid in the searchstr so prevent cataloguenumber or taglist search. + if (query.IsImdbQuery) + { + query.SearchTerm = query.ImdbID; + query.ImdbID = null; + } + + return await base.PerformQuery(query); + } + + protected override bool ReleaseInfoPostParse(ReleaseInfo release, JObject torrent, JObject result) + { + // override release title + var groupName = WebUtility.HtmlDecode((string)result["groupName"]); + var groupSubName = WebUtility.HtmlDecode((string)result["groupSubName"]); + var groupYear = (string)result["groupYear"]; + var title = new StringBuilder(); + title.Append(groupName); + if (!string.IsNullOrEmpty(groupSubName)) + title.Append(" " + groupSubName + " "); + + if (!string.IsNullOrEmpty(groupYear) && groupYear != "0") + title.Append(" [" + groupYear + "]"); + + + var torrentId = torrent["torrentId"]; + + var flags = new List(); + + var codec = (string)torrent["codec"]; + if (!string.IsNullOrEmpty(codec)) + flags.Add(codec); + + var source = (string)torrent["source"]; + if (!string.IsNullOrEmpty(source)) + flags.Add(source); + + var resolution = (string)torrent["resolution"]; + if (!string.IsNullOrEmpty(resolution)) + flags.Add(resolution); + + var container = (string)torrent["container"]; + if (!string.IsNullOrEmpty(container)) + flags.Add(container); + + var processing = (string)torrent["processing"]; + if (!string.IsNullOrEmpty(processing)) + flags.Add(processing); + + if (flags.Count > 0) + title.Append(" " + string.Join(" / ", flags)); + + release.Title = title.ToString(); + switch ((string)torrent["freeType"]) + { + case "11": + release.DownloadVolumeFactor = 0.75; + break; + case "12": + release.DownloadVolumeFactor = 0.5; + break; + case "13": + release.DownloadVolumeFactor = 0.25; + break; + case "1": + release.DownloadVolumeFactor = 0; + break; + case "2": + release.DownloadVolumeFactor = 0; + release.UploadVolumeFactor = 0; + break; + } + + var isPersonalFreeleech = (bool?)torrent["isPersonalFreeleech"]; + if (isPersonalFreeleech != null && isPersonalFreeleech == true) + release.DownloadVolumeFactor = 0; + + var imdbID = (string)result["imdbId"]; + if (!string.IsNullOrEmpty(imdbID)) + release.Imdb = ParseUtil.GetImdbID(imdbID); + + release.MinimumRatio = 1; + release.MinimumSeedTime = 172800; // 48 hours + // tag each results with Movie cats. + release.Category = new List { TorznabCatType.Movies.ID }; + return true; + } + } +} diff --git a/src/Jackett.Common/Indexers/Seals.cs b/src/Jackett.Common/Indexers/Seals.cs deleted file mode 100644 index 36661233b..000000000 --- a/src/Jackett.Common/Indexers/Seals.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -using Jackett.Common.Indexers.Abstract; -using Jackett.Common.Models; -using Jackett.Common.Services.Interfaces; -using Jackett.Common.Utils; -using Jackett.Common.Utils.Clients; -using NLog; - -namespace Jackett.Common.Indexers -{ - [ExcludeFromCodeCoverage] - public class Seals : GazelleTracker - { - public Seals(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps, - ICacheService cs) - : base(id: "seals", - name: "Seals", - description: "Seals is a CHINESE Private site for MOVIES / TV", - link: StringUtil.FromBase64("aHR0cHM6Ly9ncmVhdHBvc3RlcndhbGwuY29tLw=="), - caps: new TorznabCapabilities - { - TvSearchParams = new List - { - TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep - }, - MovieSearchParams = new List - { - MovieSearchParam.Q, MovieSearchParam.ImdbId - } - }, - configService: configService, - client: wc, - logger: l, - p: ps, - cs: cs, - supportsFreeleechTokens: true, - imdbInTags: false, - has2Fa: true, - useApiKey: false, - usePassKey: false, - instructionMessageOptional: null - ) - { - Language = "zh-CN"; - Type = "private"; - - // Seals does not have categories so these are just to tag the results with both for torznab apps. - AddCategoryMapping(1, TorznabCatType.Movies, "Movies 电影"); - AddCategoryMapping(2, TorznabCatType.TV, "TV 电视"); - } - - protected override async Task> PerformQuery(TorznabQuery query) - { - // Seals does not support categories so drop cat filtering. - query.Categories = new int[0]; - - // Seals uses imdbid in the searchstr so prevent cataloguenumber or taglist search. - if (query.IsImdbQuery) - { - query.SearchTerm = query.ImdbID; - query.ImdbID = null; - } - - var releases = await base.PerformQuery(query); - foreach (var release in releases) - { - release.MinimumRatio = 1; - release.MinimumSeedTime = 172800; // 48 hours - // tag each results with both Movie and TV cats. - release.Category = new List { TorznabCatType.Movies.ID, TorznabCatType.TV.ID }; - // Seals loads artist with the movie director and the gazelleTracker abstract - // places it in front of the movie separated with a dash. - // eg. Keishi Ohtomo -​ Rurouni Kenshin Part II: Kyoto Inferno [2014] [Feature Film] 1080p /​ MKV /​ x264 /​ 0 - // We need to strip it or Radarr will not get a title match for automatic DL - var artistEndsAt = release.Title.IndexOf(" - "); - if (artistEndsAt > -1) - { - release.Title = release.Title.Substring(artistEndsAt + 3); - } - } - return releases; - } - } -} diff --git a/src/Jackett.Common/Services/IndexerManagerService.cs b/src/Jackett.Common/Services/IndexerManagerService.cs index f691bb614..f2c164352 100644 --- a/src/Jackett.Common/Services/IndexerManagerService.cs +++ b/src/Jackett.Common/Services/IndexerManagerService.cs @@ -42,7 +42,6 @@ namespace Jackett.Common.Services { {"audiobooktorrents", "abtorrents"}, {"broadcastthenet", "broadcasthenet"}, - {"todotorrents", "dontorrent"}, {"hdreactor", "hdhouse"}, {"icetorrent", "speedapp"}, {"kickasstorrent-kathow", "kickasstorrents-ws"}, @@ -54,7 +53,9 @@ namespace Jackett.Common.Services {"puntorrent", "puntotorrent"}, {"rstorrent", "redstartorrent"}, {"scenefz", "speedapp"}, + {"seals", "greatposterwall"}, {"tehconnectionme", "anthelion"}, + {"todotorrents", "dontorrent"}, {"torrentgalaxyorg", "torrentgalaxy"}, {"transmithenet", "nebulance"}, {"xtremezone", "speedapp"},