From b3669e8e32defcd3e9fd3e4f470ef18f1726bb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=9A=28noham=29=C2=B2?= <100566912+NohamR@users.noreply.github.com> Date: Wed, 12 Mar 2025 23:46:26 +0100 Subject: [PATCH] Add Phoenix Project, a private site. resolves #15911 (#15910) --- README.md | 1 + .../Indexers/Definitions/PhoenixProject.cs | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 src/Jackett.Common/Indexers/Definitions/PhoenixProject.cs diff --git a/README.md b/README.md index 813e681d4..8a4ebf558 100644 --- a/README.md +++ b/README.md @@ -489,6 +489,7 @@ Prior versions of Jackett are no longer supported. * PassThePopcorn (PTP) [![(invite needed)][inviteneeded]](#) * Peeratiko * Peers.FM + * Phoenix Project [![(invite needed)][inviteneeded]](#) * PigNetwork (猪猪网) * PixelCove (Ultimate Gamer) * PiXELHD (PxHD) [![(invite needed)][inviteneeded]](#) diff --git a/src/Jackett.Common/Indexers/Definitions/PhoenixProject.cs b/src/Jackett.Common/Indexers/Definitions/PhoenixProject.cs new file mode 100644 index 000000000..6cdb95153 --- /dev/null +++ b/src/Jackett.Common/Indexers/Definitions/PhoenixProject.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Jackett.Common.Indexers.Definitions.Abstract; +using Jackett.Common.Models; +using Jackett.Common.Services.Interfaces; +using NLog; +using static Jackett.Common.Models.IndexerConfig.ConfigurationData; +using WebClient = Jackett.Common.Utils.Clients.WebClient; + +namespace Jackett.Common.Indexers.Definitions +{ + [ExcludeFromCodeCoverage] + public class PhoenixProject : GazelleTracker + { + public override string Id => "phoenixproject"; + public override string Name => "Phoenix Project"; + public override string Description => "MacOS software tracker"; + public override string SiteLink { get; protected set; } = "https://phoenixproject.app/"; + public override string Language => "en-US"; + public override string Type => "private"; + + public override TorznabCapabilities TorznabCaps => SetCapabilities(); + + protected override string AuthorizationFormat => "token {0}"; + protected override int ApiKeyLength => 118; + + public PhoenixProject(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps, ICacheService cs) + : base(configService: configService, + client: wc, + logger: l, + p: ps, + cs: cs, + supportsFreeleechTokens: true, + useApiKey: true, + instructionMessageOptional: "
  1. Go to PhoenixProject's site and open your account settings.
  2. Go to Access Settings tab use the API Keys: click here to create a new token link.
  3. Give it a name and click Generate.
  4. Finally, copy/paste the token to your Jackett config APIKey input box.
" + ) + { + configData.AddDynamic("Account Inactivity", new DisplayInfoConfigurationItem("Account Inactivity", "To keep your account active, sign in and browse the site at least once every 120 days. Seeding torrents does not count as account activity, so in order to remain active you need to sign in and browse the site. Power Users (and above) are immune to the inactivity timer, but logging in regularly is recommended to learn about special events and new features. Donors are exempt from automatic account disabling due to inactivity. If you wish to always maintain an active account consider donating.")); + } + + protected override string FlipOptionalTokenString(string requestLink) => requestLink.Replace("&usetoken=1", ""); + + private TorznabCapabilities SetCapabilities() + { + var caps = new TorznabCapabilities + { + MusicSearchParams = new List + { + MusicSearchParam.Q + } + }; + + caps.Categories.AddCategoryMapping(1, TorznabCatType.PCMac, "Applications"); + caps.Categories.AddCategoryMapping(2, TorznabCatType.PCGames, "Games"); + caps.Categories.AddCategoryMapping(3, TorznabCatType.PCMobileiOS, "IOS Applications"); + caps.Categories.AddCategoryMapping(4, TorznabCatType.PCMobileiOS, "IOS Games"); + caps.Categories.AddCategoryMapping(5, TorznabCatType.Other, "Graphics"); + caps.Categories.AddCategoryMapping(6, TorznabCatType.Audio, "Audio"); + caps.Categories.AddCategoryMapping(7, TorznabCatType.Other, "Tutorials"); + caps.Categories.AddCategoryMapping(8, TorznabCatType.Other, "Other"); + + return caps; + } + + protected override Uri GetDownloadUrl(int torrentId, bool canUseToken) + { + return new Uri($"{SiteLink}ajax.php?action=download{(useTokens && canUseToken ? "&usetoken=1" : "")}&id={torrentId}"); + } + } +}