2020-02-09 02:35:16 +00:00
|
|
|
using System.Collections.Generic;
|
2020-05-03 23:35:52 +00:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2020-05-30 11:06:43 +00:00
|
|
|
using System.Linq;
|
|
|
|
using System.Threading.Tasks;
|
2018-03-10 08:05:56 +00:00
|
|
|
using Jackett.Common.Indexers.Abstract;
|
|
|
|
using Jackett.Common.Models;
|
|
|
|
using Jackett.Common.Services.Interfaces;
|
|
|
|
using Jackett.Common.Utils.Clients;
|
2018-01-03 18:46:12 +00:00
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using NLog;
|
|
|
|
|
2018-03-10 08:05:56 +00:00
|
|
|
namespace Jackett.Common.Indexers
|
2018-01-03 18:46:12 +00:00
|
|
|
{
|
2020-05-03 23:35:52 +00:00
|
|
|
[ExcludeFromCodeCoverage]
|
2018-01-03 18:46:12 +00:00
|
|
|
public class SecretCinema : GazelleTracker
|
|
|
|
{
|
2020-12-11 22:14:21 +00:00
|
|
|
public SecretCinema(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
|
|
|
ICacheService cs)
|
2020-05-11 19:59:28 +00:00
|
|
|
: base(id: "secretcinema",
|
|
|
|
name: "Secret Cinema",
|
2020-04-04 06:56:51 +00:00
|
|
|
description: "A tracker for rare movies.",
|
|
|
|
link: "https://secret-cinema.pw/",
|
|
|
|
caps: new TorznabCapabilities
|
|
|
|
{
|
2020-10-18 20:47:36 +00:00
|
|
|
MovieSearchParams = new List<MovieSearchParam>
|
|
|
|
{
|
|
|
|
MovieSearchParam.Q, MovieSearchParam.ImdbId
|
|
|
|
},
|
2020-10-18 21:20:08 +00:00
|
|
|
MusicSearchParams = new List<MusicSearchParam>
|
2020-10-18 20:47:36 +00:00
|
|
|
{
|
2020-10-18 21:20:08 +00:00
|
|
|
MusicSearchParam.Q, MusicSearchParam.Album, MusicSearchParam.Artist, MusicSearchParam.Label, MusicSearchParam.Year
|
2020-10-18 20:47:36 +00:00
|
|
|
}
|
2020-04-04 06:56:51 +00:00
|
|
|
},
|
|
|
|
configService: configService,
|
|
|
|
client: wc,
|
|
|
|
logger: l,
|
|
|
|
p: ps,
|
2020-12-11 22:14:21 +00:00
|
|
|
cs: cs,
|
2020-04-04 06:56:51 +00:00
|
|
|
supportsFreeleechTokens: false) // ratioless tracker
|
2018-01-03 18:46:12 +00:00
|
|
|
{
|
|
|
|
Language = "en-us";
|
|
|
|
Type = "private";
|
|
|
|
|
|
|
|
AddCategoryMapping(1, TorznabCatType.Movies, "Movies");
|
|
|
|
AddCategoryMapping(2, TorznabCatType.Audio, "Music");
|
2020-05-30 11:06:43 +00:00
|
|
|
// cat=3 exists but it's required a refactor in Gazelle abstract to make it work
|
|
|
|
//AddCategoryMapping(3, TorznabCatType.Books, "E-Books");
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2018-01-03 18:46:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override bool ReleaseInfoPostParse(ReleaseInfo release, JObject torrent, JObject result)
|
|
|
|
{
|
|
|
|
var media = (string)torrent["media"];
|
2020-05-30 11:06:43 +00:00
|
|
|
if (string.IsNullOrEmpty(media))
|
|
|
|
return true;
|
|
|
|
switch (media)
|
2018-01-03 18:46:12 +00:00
|
|
|
{
|
2020-05-30 11:06:43 +00:00
|
|
|
case "SD":
|
|
|
|
release.Category.Remove(TorznabCatType.Movies.ID);
|
|
|
|
release.Category.Add(TorznabCatType.MoviesSD.ID);
|
|
|
|
break;
|
|
|
|
case "720p":
|
|
|
|
case "1080p":
|
|
|
|
case "4k": // not verified
|
|
|
|
release.Category.Remove(TorznabCatType.Movies.ID);
|
|
|
|
release.Category.Add(TorznabCatType.MoviesHD.ID);
|
|
|
|
break;
|
|
|
|
case "DVD-R":
|
|
|
|
release.Category.Remove(TorznabCatType.Movies.ID);
|
|
|
|
release.Category.Add(TorznabCatType.MoviesDVD.ID);
|
|
|
|
break;
|
|
|
|
case "BDMV":
|
|
|
|
release.Category.Remove(TorznabCatType.Movies.ID);
|
|
|
|
release.Category.Add(TorznabCatType.MoviesBluRay.ID);
|
|
|
|
break;
|
2018-01-03 18:46:12 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2020-02-09 02:35:16 +00:00
|
|
|
}
|