From 1a9d0fc20616e3c8acb60b58b90684b292c01c11 Mon Sep 17 00:00:00 2001 From: Diego Heras Date: Sun, 16 Jan 2022 19:34:50 +0100 Subject: [PATCH] torrentday: add freeleech only. #9456 (#12842) --- src/Jackett.Common/Indexers/TorrentDay.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Jackett.Common/Indexers/TorrentDay.cs b/src/Jackett.Common/Indexers/TorrentDay.cs index 22ce78fa1..4fbb14aa1 100644 --- a/src/Jackett.Common/Indexers/TorrentDay.cs +++ b/src/Jackett.Common/Indexers/TorrentDay.cs @@ -13,6 +13,7 @@ using Jackett.Common.Utils.Clients; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NLog; +using static Jackett.Common.Models.IndexerConfig.ConfigurationData; namespace Jackett.Common.Indexers { @@ -85,6 +86,8 @@ namespace Jackett.Common.Indexers wc.EmulateBrowser = false; + configData.AddDynamic("freeleech", new BoolConfigurationItem("Search freeleech only") { Value = false }); + AddCategoryMapping(29, TorznabCatType.TVAnime, "Anime"); AddCategoryMapping(28, TorznabCatType.PC, "Appz/Packs"); AddCategoryMapping(42, TorznabCatType.AudioAudiobook, "Audio Books"); @@ -171,6 +174,9 @@ namespace Jackett.Common.Indexers else searchUrl += ";q=" + WebUtilityHelpers.UrlEncode(query.GetQueryString(), Encoding); + if (((BoolConfigurationItem)configData.GetDynamic("freeleech")).Value) + searchUrl += ";free=on"; + var results = await RequestWithCookiesAndRetryAsync(searchUrl); // Check for being logged out