Jackett/src/Jackett.Common/Indexers/Redacted.cs

75 lines
2.9 KiB
C#
Raw Normal View History

2020-02-09 02:35:16 +00:00
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
using Jackett.Common.Services.Interfaces;
2017-10-29 06:50:47 +00:00
using NLog;
using WebClient = Jackett.Common.Utils.Clients.WebClient;
namespace Jackett.Common.Indexers
2016-12-17 15:49:52 +00:00
{
[ExcludeFromCodeCoverage]
public class Redacted : GazelleTracker
2016-12-17 15:49:52 +00:00
{
protected override string DownloadUrl => SiteLink + "torrents.php?action=download&usetoken=" + (useTokens ? "1" : "0") + "&id=";
public Redacted(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps)
: base(id: "redacted",
name: "Redacted",
description: "A music tracker",
link: "https://redacted.ch/",
caps: new TorznabCapabilities
{
TvSearchParams = new List<TvSearchParam>
{
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep
},
MovieSearchParams = new List<MovieSearchParam>
{
MovieSearchParam.Q
},
2020-10-18 21:20:08 +00:00
MusicSearchParams = new List<MusicSearchParam>
{
2020-10-18 21:20:08 +00:00
MusicSearchParam.Q, MusicSearchParam.Album, MusicSearchParam.Artist, MusicSearchParam.Label, MusicSearchParam.Year
},
BookSearchParams = new List<BookSearchParam>
{
BookSearchParam.Q
}
},
configService: configService,
client: wc,
logger: l,
p: ps,
supportsFreeleechTokens: true,
has2Fa: true,
useApiKey: false
)
2016-12-17 15:49:52 +00:00
{
Language = "en-us";
Type = "private";
2016-12-17 15:49:52 +00:00
webclient.EmulateBrowser = false; // Issue #9751
2016-12-17 15:49:52 +00:00
AddCategoryMapping(1, TorznabCatType.Audio, "Music");
AddCategoryMapping(2, TorznabCatType.PC, "Applications");
AddCategoryMapping(3, TorznabCatType.Books, "E-Books");
AddCategoryMapping(4, TorznabCatType.AudioAudiobook, "Audiobooks");
AddCategoryMapping(5, TorznabCatType.Movies, "E-Learning Videos");
AddCategoryMapping(6, TorznabCatType.TV, "Comedy");
AddCategoryMapping(7, TorznabCatType.Books, "Comics");
2016-12-17 15:49:52 +00:00
}
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
{
var results = await base.PerformQuery(query);
// results must contain search terms
results = results.Where(release => query.MatchQueryStringAND(release.Title));
return results;
}
2016-12-17 15:49:52 +00:00
}
2020-02-09 02:35:16 +00:00
}