Add option to search freeleech only on IPTorrents (#10871)

This commit is contained in:
GordonFreemanK
2021-01-31 11:46:23 +00:00
committed by GitHub
parent 4929b641e6
commit 41584628e2

View File

@@ -13,6 +13,7 @@ using Jackett.Common.Utils;
using Jackett.Common.Utils.Clients;
using Newtonsoft.Json.Linq;
using NLog;
using static Jackett.Common.Models.IndexerConfig.ConfigurationData;
namespace Jackett.Common.Indexers
{
@@ -86,6 +87,8 @@ namespace Jackett.Common.Indexers
Language = "en-us";
Type = "private";
configData.AddDynamic("freeleech", new BoolItem { Name = "Search freeleech only", Value = false });
AddCategoryMapping(72, TorznabCatType.Movies, "Movies");
AddCategoryMapping(87, TorznabCatType.Movies3D, "Movie/3D");
AddCategoryMapping(77, TorznabCatType.MoviesSD, "Movie/480p");
@@ -194,6 +197,9 @@ namespace Jackett.Common.Indexers
foreach (var cat in MapTorznabCapsToTrackers(query))
qc.Add(cat, string.Empty);
if (((BoolItem)configData.GetDynamic("freeleech")).Value)
qc.Add("free", "on");
var searchUrl = SearchUrl + "?" + qc.GetQueryString();
var response = await RequestWithCookiesAndRetryAsync(searchUrl, referer: SearchUrl);
var results = response.ContentString;