1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-03-06 11:48:49 +00:00

torrentleech: add freeleech only option #9456 #10280 (#10298)

This commit is contained in:
Diego Heras 2020-11-25 19:16:36 +01:00 committed by GitHub
parent 79ca5b2f73
commit 4967fe4f60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@ using Jackett.Common.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NLog;
using static Jackett.Common.Models.IndexerConfig.ConfigurationData;
namespace Jackett.Common.Indexers
{
@ -64,6 +65,8 @@ namespace Jackett.Common.Indexers
Language = "en-us";
Type = "private";
configData.AddDynamic("freeleech", new BoolItem { Name = "Search freeleech only", Value = false });
AddCategoryMapping(1, TorznabCatType.Movies, "Movies");
AddCategoryMapping(8, TorznabCatType.MoviesSD, "Movies Cam");
AddCategoryMapping(9, TorznabCatType.MoviesSD, "Movies TS/TC");
@ -151,6 +154,10 @@ namespace Jackett.Common.Indexers
searchString = Regex.Replace(searchString, @"(^|\s)-", " ");
var searchUrl = SearchUrl;
if (((BoolItem) configData.GetDynamic("freeleech")).Value)
searchUrl += "facets/tags%3AFREELEECH/";
if (query.IsImdbQuery)
searchUrl += "imdbID/" + query.ImdbID + "/";
else if (!string.IsNullOrWhiteSpace(searchString))