torrentday: add freeleech only. #9456 (#12842)

This commit is contained in:
Diego Heras 2022-01-16 19:34:50 +01:00 committed by GitHub
parent 2a23f98682
commit 1a9d0fc206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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