core: separate categories from movie-search (#9862)

* Categories and Torznab movie-search are separated
* Movie-search parameters are validated
* Fixed some bugs in Cardigann indexers
This commit is contained in:
Diego Heras 2020-10-18 19:26:22 +02:00 committed by GitHub
parent 1fcd467996
commit 9cdad3de64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 332 additions and 235 deletions

View File

@ -53,6 +53,7 @@ caps:
modes:
search: [q]
movie-search: [q]
music-search: [q, album, artist, label, year]
book-search: [q]

View File

@ -59,6 +59,7 @@ caps:
modes:
search: [q]
movie-search: [q]
book-search: [q]
login:

View File

@ -73,6 +73,7 @@ caps:
modes:
search: [q]
movie-search: [q]
book-search: [q]
login:

View File

@ -77,6 +77,7 @@ caps:
- {id: 64, cat: XXX, desc: "Scat"}
modes:
search: [q]
movie-search: [q]
book-search: [q]
login:

View File

@ -94,6 +94,7 @@ caps:
modes:
search: [q]
movie-search: [q]
book-search: [q]
settings:

View File

@ -64,6 +64,7 @@ caps:
modes:
search: [q]
tv-search: [q, season, ep]
movie-search: [q]
book-search: [q]
settings:

View File

@ -43,6 +43,7 @@ caps:
modes:
search: [q]
movie-search: [q]
settings: []

View File

@ -56,7 +56,9 @@ namespace Jackett.Common.Indexers
name: "Abnormal",
description: "General French Private Tracker",
link: "https://abnormal.ws/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: w,
logger: l,

View File

@ -19,7 +19,7 @@ namespace Jackett.Common.Indexers
link: "https://alpharatio.cc/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -43,15 +43,9 @@ namespace Jackett.Common.Indexers
link: "https://animebytes.tv/",
configService: configService,
client: client,
caps: new TorznabCapabilities(TorznabCatType.TVAnime,
TorznabCatType.Movies,
TorznabCatType.BooksComics,
TorznabCatType.ConsolePSP,
TorznabCatType.ConsoleOther,
TorznabCatType.PCGames,
TorznabCatType.AudioMP3,
TorznabCatType.AudioLossless,
TorznabCatType.AudioOther),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
logger: l,
p: ps,
configData: new ConfigurationDataAnimeBytes("Note: Go to AnimeBytes site and open your account settings. Go to 'Account' tab, move cursor over black part near 'Passkey' and copy its value. Your username is case sensitive."))

View File

@ -37,7 +37,9 @@ namespace Jackett.Common.Indexers
name: "AnimeTorrents",
description: "Definitive source for anime and manga",
link: "https://animetorrents.me/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: c,
logger: l,

View File

@ -35,7 +35,9 @@ namespace Jackett.Common.Indexers
name: "Anthelion", // old name: TehConnection.me
description: "A movies tracker",
link: "https://anthelion.me/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -17,7 +18,7 @@ namespace Jackett.Common.Indexers
link: "https://avistaz.to/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -31,7 +31,7 @@ namespace Jackett.Common.Indexers
link: "https://awesome-hd.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -38,7 +38,9 @@ namespace Jackett.Common.Indexers
name: "bB",
description: "bB is a Private Torrent Tracker for 0DAY / GENERAL",
link: StringUtil.FromBase64("aHR0cHM6Ly9iYWNvbmJpdHMub3JnLw=="),
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: w,
logger: l,

View File

@ -67,7 +67,7 @@ namespace Jackett.Common.Indexers
link: "https://bj-share.info/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -41,7 +41,7 @@ namespace Jackett.Common.Indexers
name: "BakaBT",
description: "Anime Comunity",
link: "https://bakabt.me/",
caps: new TorznabCapabilities(TorznabCatType.TVAnime),
caps: new TorznabCapabilities(),
configService: configService,
client: wc,
logger: l,
@ -52,6 +52,7 @@ namespace Jackett.Common.Indexers
Encoding = Encoding.UTF8;
Language = "en-us";
Type = "private";
AddCategoryMapping(1, TorznabCatType.TVAnime, "Anime Series");
AddCategoryMapping(2, TorznabCatType.TVAnime, "OVA");
AddCategoryMapping(3, TorznabCatType.AudioOther, "Soundtrack");

View File

@ -287,9 +287,9 @@ namespace Jackett.Common.Indexers
return false;
if (caps.SupportsImdbTVSearch && query.IsImdbQuery && query.IsTVSearch)
return true;
if (caps.SupportsImdbMovieSearch && query.IsImdbQuery && query.IsMovieSearch)
if (caps.MovieSearchImdbAvailable && query.IsImdbQuery && query.IsMovieSearch)
return true;
else if (!caps.SupportsImdbMovieSearch && query.IsImdbQuery && query.QueryType != "TorrentPotato") // potato query should always contain imdb+search term
else if (!caps.MovieSearchImdbAvailable && query.IsImdbQuery && query.QueryType != "TorrentPotato") // potato query should always contain imdb+search term
return false;
if (caps.SearchAvailable && query.IsSearch)
return true;
@ -305,9 +305,9 @@ namespace Jackett.Common.Indexers
return true;
if (caps.SupportsTvdbSearch && query.IsTvdbSearch)
return true;
if (caps.SupportsImdbMovieSearch && query.IsImdbQuery)
if (caps.MovieSearchImdbAvailable && query.IsImdbQuery)
return true;
if (caps.SupportsTmdbMovieSearch && query.IsTmdbQuery)
if (caps.MovieSearchTmdbAvailable && query.IsTmdbQuery)
return true;
return false;
@ -583,11 +583,7 @@ namespace Jackett.Common.Indexers
{
categoryMapping.Add(new CategoryMapping(trackerCategory, trackerCategoryDesc, newznabCategory.ID));
if (!TorznabCaps.Categories.Contains(newznabCategory))
{
TorznabCaps.Categories.Add(newznabCategory);
if (TorznabCatType.Movies.Contains(newznabCategory))
TorznabCaps.MovieSearchAvailable = true;
}
// add 1:1 categories
if (trackerCategoryDesc != null && trackerCategory != null)

View File

@ -35,7 +35,9 @@ namespace Jackett.Common.Indexers
name: "Bit-City Reloaded",
description: "A German general tracker.",
link: "https://bc-reloaded.net/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -34,7 +34,7 @@ namespace Jackett.Common.Indexers
link: "https://www.bit-hdtv.com/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -116,10 +116,10 @@ namespace Jackett.Common.Indexers
// SupportsImdbTVSearch temporarily disabled due to #8107
// SupportsImdbTVSearch = Definition.Caps.Modes.Any(c => c.Key == "tv-search" && c.Value.Contains("imdbid")),
SupportsTvdbSearch = Definition.Caps.Modes.Any(c => c.Key == "tv-search" && c.Value.Contains("tvdbid")),
SupportsImdbMovieSearch = Definition.Caps.Modes.Any(c => c.Key == "movie-search" && c.Value.Contains("imdbid")),
SupportsTmdbMovieSearch = Definition.Caps.Modes.Any(c => c.Key == "movie-search" && c.Value.Contains("tmdbid")),
BookSearchAvailable = Definition.Caps.Modes.Any(c => c.Key == "book-search" && c.Value.Contains("author") && c.Value.Contains("title"))
};
if (Definition.Caps.Modes.ContainsKey("movie-search"))
TorznabCaps.ParseMovieSearchParams(Definition.Caps.Modes["movie-search"]);
if (Definition.Caps.Modes.ContainsKey("music-search"))
TorznabCaps.SupportedMusicSearchParamsList = Definition.Caps.Modes["music-search"];
@ -1624,10 +1624,10 @@ namespace Jackett.Common.Indexers
if (Filter.Args != null)
CharacterLimit = int.Parse(Filter.Args);
if (query.ImdbID != null && TorznabCaps.SupportsImdbMovieSearch)
if (query.ImdbID != null && TorznabCaps.MovieSearchImdbAvailable)
break; // skip andmatch filter for imdb searches
if (query.TmdbID != null && TorznabCaps.SupportsTmdbMovieSearch)
if (query.TmdbID != null && TorznabCaps.MovieSearchTmdbAvailable)
break; // skip andmatch filter for tmdb searches
if (query.TvdbID != null && TorznabCaps.SupportsTvdbSearch)

View File

@ -36,7 +36,9 @@ namespace Jackett.Common.Indexers
name: "Cinecalidad",
description: "Películas Full HD en Castellano y Latino Dual.",
link: "https://www.cinecalidad.is/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -17,7 +18,7 @@ namespace Jackett.Common.Indexers
link: "https://cinemaz.to/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -50,7 +50,9 @@ namespace Jackett.Common.Indexers
name: "Corsaro.red",
description: "Italian Torrents",
link: "https://corsaro.red/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -32,7 +32,7 @@ namespace Jackett.Common.Indexers
link: "https://danishbits.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -40,7 +40,9 @@ namespace Jackett.Common.Indexers
name: "Darmowe torenty",
description: "Darmowe torenty is a POLISH Semi-Private Torrent Tracker for MOVIES / TV / GENERAL",
link: "https://darmowe-torenty.pl/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -36,7 +36,7 @@ namespace Jackett.Common.Indexers
link: "https://digitalcore.club/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: w,

View File

@ -50,7 +50,9 @@ namespace Jackett.Common.Indexers
name: "DivxTotal",
description: "DivxTotal is a SPANISH site for Movies, TV series and Software",
link: "https://www.divxtotal.la/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: w,
logger: l,

View File

@ -31,7 +31,7 @@ namespace Jackett.Common.Indexers
link: "https://elite-tracker.net/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -54,7 +54,7 @@ namespace Jackett.Common.Indexers
name: "EpubLibre",
description: "Más libros, Más libres",
link: "https://epublibre.org/",
caps: new TorznabCapabilities(TorznabCatType.BooksEbook),
caps: new TorznabCapabilities(),
configService: configService,
client: wc,
logger: l,
@ -64,6 +64,8 @@ namespace Jackett.Common.Indexers
Encoding = Encoding.UTF8;
Language = "es-es";
Type = "public";
AddCategoryMapping(1, TorznabCatType.BooksEbook);
}
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)

View File

@ -37,7 +37,7 @@ namespace Jackett.Common.Indexers
link: "https://filelist.io/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -30,7 +30,7 @@ namespace Jackett.Common.Indexers
link: "https://www.funfile.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -43,7 +43,7 @@ namespace Jackett.Common.Indexers
link: "https://www.fuzer.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: w,

View File

@ -280,7 +280,7 @@ namespace Jackett.Common.Indexers
continue;
var qDetailsLink = Row.QuerySelector("a[href^=\"torrents.php?id=\"]");
var title = qDetailsLink.TextContent.Replace(", Freeleech!", "").Replace(", Neutral Leech!", "");
if (stickyGroup && (query.ImdbID == null || !TorznabCaps.SupportsImdbMovieSearch) && !query.MatchQueryStringAND(title)) // AND match for sticky releases
if (stickyGroup && (query.ImdbID == null || !TorznabCaps.MovieSearchImdbAvailable) && !query.MatchQueryStringAND(title)) // AND match for sticky releases
continue;
var qDescription = qDetailsLink.QuerySelector("span.torrent_info_tags");
var qDLLink = Row.QuerySelector("a[href^=\"torrents.php?action=download\"]");

View File

@ -34,7 +34,9 @@ namespace Jackett.Common.Indexers
name: "GimmePeers",
description: "Formerly ILT",
link: "https://www.gimmepeers.com/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -32,7 +32,7 @@ namespace Jackett.Common.Indexers
link: "https://hdbits.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true,
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId },
SupportsTvdbSearch= true
},
configService: configService,

View File

@ -32,7 +32,7 @@ namespace Jackett.Common.Indexers
link: "https://hd-space.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
//SupportsImdbTVSearch = true; (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -51,7 +51,7 @@ namespace Jackett.Common.Indexers
link: "https://hdts.ru/", // Domain https://hdts.ru/ seems more reliable
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -34,7 +34,9 @@ namespace Jackett.Common.Indexers
name: "Hebits",
description: "The Israeli Tracker",
link: "https://hebits.net/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -56,7 +56,7 @@ namespace Jackett.Common.Indexers
link: "https://iptorrents.com/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -22,7 +23,7 @@ namespace Jackett.Common.Indexers
link: "https://icetorrent.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -39,7 +39,9 @@ namespace Jackett.Common.Indexers
name: "ImmortalSeed",
description: "ImmortalSeed (iS) is a Private Torrent Tracker for MOVIES / TV / GENERAL",
link: "https://immortalseed.me/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -46,7 +46,9 @@ namespace Jackett.Common.Indexers
name: "Internet Archive",
description: "Internet Archive is a non-profit digital library offering free universal access to books, movies & music, as well as 406 billion archived web pages",
link: "https://archive.org/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -98,7 +98,9 @@ namespace Jackett.Common.Indexers
name: "LostFilm.tv",
description: "Unique portal about foreign series",
link: "https://www.lostfilm.run/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -48,7 +48,9 @@ namespace Jackett.Common.Indexers
name: "MejorTorrent",
description: "MejorTorrent - Hay veces que un torrent viene mejor! :)",
link: "https://www.mejortorrentt.net/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: w,
logger: l,

View File

@ -28,7 +28,9 @@ namespace Jackett.Common.Indexers
name: "Milkie",
description: "Milkie.cc (ME) is private torrent tracker for 0day / general",
link: "https://milkie.cc/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -33,15 +33,15 @@ namespace Jackett.Common.Indexers
private ConfigurationDataBasicLogin ConfigData => (ConfigurationDataBasicLogin)configData;
public MoreThanTV(IIndexerConfigurationService configService, Utils.Clients.WebClient c, Logger l, IProtectionService ps)
public MoreThanTV(IIndexerConfigurationService configService, WebClient c, Logger l, IProtectionService ps)
: base(id: "morethantv",
name: "MoreThanTV",
description: "Private torrent tracker for TV / MOVIES, and the internal tracker for the release group DRACULA.",
link: "https://www.morethantv.me/",
caps: new TorznabCapabilities(
TorznabCatType.Movies,
TorznabCatType.TV,
TorznabCatType.Other),
caps: new TorznabCapabilities
{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: c,
logger: l,
@ -52,7 +52,9 @@ namespace Jackett.Common.Indexers
Language = "en-us";
Type = "private";
TorznabCaps.SupportsImdbMovieSearch = true;
AddCategoryMapping(1, TorznabCatType.Movies);
AddCategoryMapping(2, TorznabCatType.TV);
AddCategoryMapping(3, TorznabCatType.Other);
}
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)

View File

@ -33,7 +33,9 @@ namespace Jackett.Common.Indexers
name: "myAmity",
description: "A German general tracker.",
link: "https://ttv2.myamity.info/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -48,7 +48,7 @@ namespace Jackett.Common.Indexers
link: "https://ncore.cc/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true,
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// supported by the site but disabled due to #8107
// SupportsImdbTVSearch = true
},
@ -61,6 +61,7 @@ namespace Jackett.Common.Indexers
Encoding = Encoding.UTF8;
Language = "hu-hu";
Type = "private";
AddCategoryMapping("xvid_hun", TorznabCatType.MoviesSD, "Film SD/HU");
AddCategoryMapping("xvid", TorznabCatType.MoviesSD, "Film SD/EN");
AddCategoryMapping("dvd_hun", TorznabCatType.MoviesDVD, "Film DVDR/HU");

View File

@ -121,10 +121,9 @@ namespace Jackett.Common.Indexers
name: "NewPCT",
description: "NewPCT - Descargar peliculas, series y estrenos torrent gratis",
link: "https://pctmix.com/",
caps: new TorznabCapabilities(TorznabCatType.TV,
TorznabCatType.TVSD,
TorznabCatType.TVHD,
TorznabCatType.Movies),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,
@ -146,6 +145,11 @@ namespace Jackett.Common.Indexers
var removeMovieYearItem = new BoolItem { Name = "Remove year from movie results (enable for Radarr)", Value = false };
configData.AddDynamic("RemoveMovieYear", removeMovieYearItem);
AddCategoryMapping(1, TorznabCatType.Movies);
AddCategoryMapping(2, TorznabCatType.TV);
AddCategoryMapping(3, TorznabCatType.TVSD);
AddCategoryMapping(4, TorznabCatType.TVHD);
}
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)

View File

@ -34,7 +34,9 @@ namespace Jackett.Common.Indexers
name: "New Real World",
description: "A German general tracker.",
link: "https://nrw-tracker.eu/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -49,7 +49,7 @@ namespace Jackett.Common.Indexers
link: "https://norbits.net/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> {MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: w,

View File

@ -18,6 +18,7 @@ namespace Jackett.Common.Indexers
link: "https://notwhat.cd/",
caps: new TorznabCapabilities
{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q },
SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
},
configService: configService,

View File

@ -18,6 +18,7 @@ namespace Jackett.Common.Indexers
link: "https://orpheus.network/",
caps: new TorznabCapabilities
{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q },
SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
},
configService: configService,

View File

@ -33,7 +33,9 @@ namespace Jackett.Common.Indexers
name: "Partis",
description: "Partis is a SLOVENIAN Private Torrent Tracker",
link: "https://www.partis.si/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -38,7 +38,7 @@ namespace Jackett.Common.Indexers
link: "https://passthepopcorn.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: c,

View File

@ -38,7 +38,7 @@ namespace Jackett.Common.Indexers
link: "http://piratethenet.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: w,

View File

@ -39,7 +39,7 @@ namespace Jackett.Common.Indexers
link: "https://pixelhd.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
logger: logger,

View File

@ -34,7 +34,7 @@ namespace Jackett.Common.Indexers
link: "https://pte.nu/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -30,7 +30,7 @@ namespace Jackett.Common.Indexers
link: "https://pretome.info/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true; (supported by the site but disabled due to #8107)
},
client: wc,

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -17,7 +18,7 @@ namespace Jackett.Common.Indexers
link: "https://privatehd.to/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -16,7 +17,9 @@ namespace Jackett.Common.Indexers
name: "Psytorrents",
description: "Psytorrents (PSY) is a Private Torrent Tracker for ELECTRONIC MUSIC",
link: "https://psytorrents.info/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -38,7 +38,7 @@ namespace Jackett.Common.Indexers
link: "https://rarbg.to/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -22,6 +22,7 @@ namespace Jackett.Common.Indexers
link: "https://redacted.ch/",
caps: new TorznabCapabilities
{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q },
SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
},
configService: configService,

View File

@ -32,7 +32,7 @@ namespace Jackett.Common.Indexers
link: "https://revolutiontt.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -39,7 +39,9 @@ namespace Jackett.Common.Indexers
name: "RuTracker",
description: "RuTracker is a Semi-Private Russian torrent site with a thriving file-sharing community",
link: "https://rutracker.org/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -23,7 +24,7 @@ namespace Jackett.Common.Indexers
link: "https://scenefz.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -33,7 +33,7 @@ namespace Jackett.Common.Indexers
configService: configService,
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
client: c,
logger: l,

View File

@ -33,7 +33,9 @@ namespace Jackett.Common.Indexers
name: "SceneTime",
description: "Always on time",
link: "https://www.scenetime.com/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: w,
logger: l,

View File

@ -21,7 +21,7 @@ namespace Jackett.Common.Indexers
link: "https://secret-cinema.pw/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true,
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId },
SupportedMusicSearchParamsList = new List<string> { "q", "album", "artist", "label", "year" }
},
configService: configService,

View File

@ -36,10 +36,7 @@ namespace Jackett.Common.Indexers
name: "Shazbat",
description: "Modern indexer",
link: "https://www.shazbat.tv/",
caps: new TorznabCapabilities(
TorznabCatType.TV,
TorznabCatType.TVHD,
TorznabCatType.TVSD),
caps: new TorznabCapabilities(),
configService: configService,
client: c,
logger: l,
@ -49,6 +46,10 @@ namespace Jackett.Common.Indexers
Encoding = Encoding.UTF8;
Language = "en-us";
Type = "private";
AddCategoryMapping(1, TorznabCatType.TV);
AddCategoryMapping(2, TorznabCatType.TVSD);
AddCategoryMapping(3, TorznabCatType.TVHD);
}
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
@ -124,7 +125,7 @@ namespace Jackett.Common.Indexers
foreach (var child in titleRow.Children)
child.Remove();
release.Title = titleRow.TextContent.Trim();
if ((query.ImdbID == null || !TorznabCaps.SupportsImdbMovieSearch) &&
if ((query.ImdbID == null || !TorznabCaps.MovieSearchImdbAvailable) &&
!query.MatchQueryStringAND(release.Title))
continue;
var bannerStyle = row.QuerySelector("div[style^=\"cursor: pointer; background-image:url\"]")

View File

@ -40,7 +40,9 @@ namespace Jackett.Common.Indexers
name: "Solid Torrents",
description: "Solid Torrents is a Public torrent meta-search engine",
link: "https://solidtorrents.net/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -39,7 +39,7 @@ namespace Jackett.Common.Indexers
link: "https://speed.cd/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -36,7 +36,7 @@ namespace Jackett.Common.Indexers
link: "https://superbits.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: w,

View File

@ -38,7 +38,7 @@ namespace Jackett.Common.Indexers
link: "https://tvstore.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true, // Needed for IMDb searches to work see #7977
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId },
SupportsImdbTVSearch = true
},
configService: configService,

View File

@ -34,7 +34,7 @@ namespace Jackett.Common.Indexers
link: "https://tv-vault.me/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -74,7 +74,9 @@ namespace Jackett.Common.Indexers
name: "The Pirate Bay",
description: "Pirate Bay (TPB) is the galaxys most resilient Public BitTorrent site",
link: "https://thepiratebay.org/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: client,
logger: logger,

View File

@ -36,7 +36,9 @@ namespace Jackett.Common.Indexers
name: "Toloka.to",
description: "Toloka is a Semi-Private Ukrainian torrent site with a thriving file-sharing community",
link: "https://toloka.to/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -31,7 +31,7 @@ namespace Jackett.Common.Indexers
link: "https://www.torrentbytes.net/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -53,7 +53,7 @@ namespace Jackett.Common.Indexers
link: "https://tday.love/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,
@ -171,7 +171,7 @@ namespace Jackett.Common.Indexers
foreach (var row in rows)
{
var title = (string)row.name;
if ((!query.IsImdbQuery || !TorznabCaps.SupportsImdbMovieSearch) && !query.MatchQueryStringAND(title))
if ((!query.IsImdbQuery || !TorznabCaps.MovieSearchImdbAvailable) && !query.MatchQueryStringAND(title))
continue;
var torrentId = (long)row.t;
var comments = new Uri(SiteLink + "details.php?id=" + torrentId);

View File

@ -25,7 +25,9 @@ namespace Jackett.Common.Indexers
name: "TorrentHeaven",
description: "A German general tracker.",
link: "https://newheaven.nl/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -38,7 +38,7 @@ namespace Jackett.Common.Indexers
link: "https://www.torrentleech.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -36,7 +36,9 @@ namespace Jackett.Common.Indexers
name: "TorrentMafya",
description: "TorrentMafya is a Turkish general torrent tracker ",
link: "https://www.torrentmafya.org/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -38,7 +38,9 @@ namespace Jackett.Common.Indexers
name: "Torrent Network",
description: "Torrent Network (TN) is a GERMAN Private site for TV / MOVIES / GENERAL",
link: "https://tntracker.org/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -32,7 +32,9 @@ namespace Jackett.Common.Indexers
name: "TorrentSeeds",
description: "TorrentSeeds is a Private site for MOVIES / TV / GENERAL",
link: "https://torrentseeds.org/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities{
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: wc,
logger: l,

View File

@ -37,7 +37,7 @@ namespace Jackett.Common.Indexers
link: "https://torrent-syndikat.org/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: w,
@ -101,8 +101,8 @@ namespace Jackett.Common.Indexers
var releases = await PerformQuery(new TorznabQuery());
await ConfigureIfOK(
string.Empty,
releases.Any(),
string.Empty,
releases.Any(),
() => throw new Exception("Could not find any releases"));
return IndexerConfigurationStatus.Completed;
@ -223,7 +223,7 @@ namespace Jackett.Common.Indexers
{
release.Description = string.Join(Environment.NewLine, descriptions);
}
releases.Add(release);
}
}

View File

@ -36,7 +36,7 @@ namespace Jackett.Common.Indexers
link: "https://www.xspeeds.eu/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -46,7 +46,9 @@ namespace Jackett.Common.Indexers
name: "Xthor",
description: "General French Private Tracker",
link: "https://xthor.tk/",
caps: new TorznabCapabilities(),
caps: new TorznabCapabilities {
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q }
},
configService: configService,
client: w,
logger: l,

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Jackett.Common.Indexers.Abstract;
using Jackett.Common.Models;
@ -23,7 +24,7 @@ namespace Jackett.Common.Indexers
link: "https://myxz.eu/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
// SupportsImdbTVSearch = true (supported by the site but disabled due to #8107)
},
configService: configService,

View File

@ -40,7 +40,7 @@ namespace Jackett.Common.Indexers
link: "https://yts.mx/",
caps: new TorznabCapabilities
{
SupportsImdbMovieSearch = true
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }
},
configService: configService,
client: wc,

View File

@ -5,6 +5,13 @@ using System.Xml.Linq;
namespace Jackett.Common.Models
{
public enum MovieSearchParam
{
Q,
ImdbId,
TmdbId
}
public class TorznabCapabilities
{
public int? LimitsMax { get; set; }
@ -13,20 +20,17 @@ namespace Jackett.Common.Models
public bool SearchAvailable { get; set; }
public bool TVSearchAvailable { get; set; }
public bool MovieSearchAvailable { get; set; }
public bool SupportsTVRageSearch { get; set; }
public bool SupportsTvdbSearch { get; set; }
public bool SupportsImdbMovieSearch { get; set; }
public bool SupportsTmdbMovieSearch { get; set; }
public bool SupportsImdbTVSearch { get; set; }
public bool SupportsTvdbSearch { get; set; }
public bool SupportsTVRageSearch { get; set; }
public bool MusicSearchAvailable => (SupportedMusicSearchParamsList.Count > 0);
public List<MovieSearchParam> MovieSearchParams;
public bool MovieSearchAvailable => (MovieSearchParams.Count > 0);
public bool MovieSearchImdbAvailable => (MovieSearchParams.Contains(MovieSearchParam.ImdbId));
public bool MovieSearchTmdbAvailable => (MovieSearchParams.Contains(MovieSearchParam.TmdbId));
public List<string> SupportedMusicSearchParamsList;
public bool MusicSearchAvailable => (SupportedMusicSearchParamsList.Count > 0);
public bool BookSearchAvailable { get; set; }
@ -34,33 +38,15 @@ namespace Jackett.Common.Models
public TorznabCapabilities()
{
Categories = new List<TorznabCategory>();
SearchAvailable = true;
TVSearchAvailable = true;
MovieSearchAvailable = false;
SupportsTVRageSearch = false;
SupportsTvdbSearch = false;
SupportsImdbMovieSearch = false;
SupportsTmdbMovieSearch = false;
SupportsImdbTVSearch = false;
SupportedMusicSearchParamsList = new List<string>();
BookSearchAvailable = false;
}
public TorznabCapabilities(params TorznabCategory[] cats)
{
SearchAvailable = true;
TVSearchAvailable = true;
SupportsTVRageSearch = false;
SupportsTvdbSearch = false;
SupportsImdbMovieSearch = false;
SupportsTmdbMovieSearch = false;
SupportsImdbTVSearch = false;
SupportsTVRageSearch = false;
MovieSearchParams = new List<MovieSearchParam>();
SupportedMusicSearchParamsList = new List<string>();
BookSearchAvailable = false;
Categories = new List<TorznabCategory>();
Categories.AddRange(cats);
MovieSearchAvailable = Categories.Any(i => TorznabCatType.Movies.Contains(i));
}
private string SupportedTVSearchParams
@ -68,27 +54,39 @@ namespace Jackett.Common.Models
get
{
var parameters = new List<string>() { "q", "season", "ep" };
if (SupportsTVRageSearch)
parameters.Add("rid");
if (SupportsTvdbSearch)
parameters.Add("tvdbid");
if (SupportsImdbTVSearch)
parameters.Add("imdbid");
if (SupportsTvdbSearch)
parameters.Add("tvdbid");
if (SupportsTVRageSearch)
parameters.Add("rid");
return string.Join(",", parameters);
}
}
private string SupportedMovieSearchParams
public void ParseMovieSearchParams(IEnumerable<string> paramsList)
{
get
{
var parameters = new List<string>() { "q" };
if (SupportsImdbMovieSearch)
parameters.Add("imdbid");
if (SupportsTmdbMovieSearch)
parameters.Add("tmdbid");
return string.Join(",", parameters);
}
if (paramsList == null)
return;
foreach (var paramStr in paramsList)
if (Enum.TryParse(paramStr, true, out MovieSearchParam param))
if (!MovieSearchParams.Contains(param))
MovieSearchParams.Add(param);
else
throw new Exception($"Duplicate movie-search param: {paramStr}");
else
throw new Exception($"Not supported movie-search param: {paramStr}");
}
private string SupportedMovieSearchParams()
{
// TODO: always enable q? It can't be disabled
var parameters = new List<string> { "q" };
if (MovieSearchImdbAvailable)
parameters.Add("imdbid");
if (MovieSearchTmdbAvailable)
parameters.Add("tmdbid");
return string.Join(",", parameters);
}
private string SupportedMusicSearchParams => string.Join(",", SupportedMusicSearchParamsList);
@ -137,7 +135,7 @@ namespace Jackett.Common.Models
),
new XElement("movie-search",
new XAttribute("available", MovieSearchAvailable ? "yes" : "no"),
new XAttribute("supportedParams", SupportedMovieSearchParams)
new XAttribute("supportedParams", SupportedMovieSearchParams())
),
new XElement("music-search",
new XAttribute("available", MusicSearchAvailable ? "yes" : "no"),
@ -177,15 +175,13 @@ namespace Jackett.Common.Models
{
lhs.SearchAvailable = lhs.SearchAvailable || rhs.SearchAvailable;
lhs.TVSearchAvailable = lhs.TVSearchAvailable || rhs.TVSearchAvailable;
lhs.MovieSearchAvailable = lhs.MovieSearchAvailable || rhs.MovieSearchAvailable;
lhs.BookSearchAvailable = lhs.BookSearchAvailable || rhs.BookSearchAvailable;
lhs.SupportsTVRageSearch = lhs.SupportsTVRageSearch || rhs.SupportsTVRageSearch;
lhs.SupportsTvdbSearch = lhs.SupportsTvdbSearch || rhs.SupportsTvdbSearch;
lhs.SupportsImdbMovieSearch = lhs.SupportsImdbMovieSearch || rhs.SupportsImdbMovieSearch;
lhs.SupportsTmdbMovieSearch = lhs.SupportsTmdbMovieSearch || rhs.SupportsTmdbMovieSearch;
lhs.SupportsImdbTVSearch = lhs.SupportsImdbTVSearch || rhs.SupportsImdbTVSearch;
lhs.SupportsTvdbSearch = lhs.SupportsTvdbSearch || rhs.SupportsTvdbSearch;
lhs.SupportsTVRageSearch = lhs.SupportsTVRageSearch || rhs.SupportsTVRageSearch;
lhs.MovieSearchParams = lhs.MovieSearchParams.Union(rhs.MovieSearchParams).ToList();
// TODO: add music search
lhs.BookSearchAvailable = lhs.BookSearchAvailable || rhs.BookSearchAvailable;
lhs.Categories.AddRange(rhs.Categories.Where(x => x.ID < 100000).Except(lhs.Categories)); // exclude indexer specific categories (>= 100000)
return lhs;
}
}

View File

@ -352,7 +352,7 @@ namespace Jackett.Server.Controllers
return GetErrorXML(201, "Incorrect parameter: invalid imdbid format");
}
if (CurrentQuery.IsMovieSearch && !CurrentIndexer.TorznabCaps.SupportsImdbMovieSearch)
if (CurrentQuery.IsMovieSearch && !CurrentIndexer.TorznabCaps.MovieSearchImdbAvailable)
{
logger.Warn($"A search request with imdbid from {Request.HttpContext.Connection.RemoteIpAddress} was made but the indexer {CurrentIndexer.DisplayName} doesn't support it.");
return GetErrorXML(203, "Function Not Available: imdbid is not supported for movie search by this indexer");
@ -367,7 +367,7 @@ namespace Jackett.Server.Controllers
if (CurrentQuery.TmdbID != null)
{
if (CurrentQuery.IsMovieSearch && !CurrentIndexer.TorznabCaps.SupportsTmdbMovieSearch)
if (CurrentQuery.IsMovieSearch && !CurrentIndexer.TorznabCaps.MovieSearchTmdbAvailable)
{
logger.Warn($"A search request with tmdbid from {Request.HttpContext.Connection.RemoteIpAddress} was made but the indexer {CurrentIndexer.DisplayName} doesn't support it.");
return GetErrorXML(203, "Function Not Available: tmdbid is not supported for movie search by this indexer");

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Jackett.Common.Models;
@ -12,46 +13,63 @@ namespace Jackett.Test.Common.Models
[Test]
public void TestConstructors()
{
// TODO: re-order atrributes in TorznabCapabilities
// TODO: tv search should be disabled by default
// TODO: TorznabCapabilities(params TorznabCategory[] cats) should re-use TorznabCapabilities
// TODO: initialize MusicSearchAvailable
var torznabCaps = new TorznabCapabilities();
Assert.True(torznabCaps.SearchAvailable);
Assert.True(torznabCaps.TVSearchAvailable);
Assert.False(torznabCaps.MovieSearchAvailable);
Assert.False(torznabCaps.MusicSearchAvailable); // init
Assert.False(torznabCaps.BookSearchAvailable);
Assert.False(torznabCaps.SupportsImdbMovieSearch);
Assert.False(torznabCaps.SupportsImdbTVSearch);
Assert.False(torznabCaps.SupportsTvdbSearch);
Assert.False(torznabCaps.SupportsTmdbMovieSearch);
Assert.False(torznabCaps.SupportsTVRageSearch);
Assert.AreEqual(0, torznabCaps.SupportedMusicSearchParamsList.Count);
Assert.AreEqual(0, torznabCaps.Categories.Count);
var cats = new TorznabCategory[0]; // empty
torznabCaps = new TorznabCapabilities(cats);
Assert.True(torznabCaps.SearchAvailable);
Assert.True(torznabCaps.TVSearchAvailable);
Assert.IsEmpty(torznabCaps.MovieSearchParams);
Assert.False(torznabCaps.MovieSearchAvailable);
Assert.False(torznabCaps.MusicSearchAvailable); // init
Assert.False(torznabCaps.BookSearchAvailable);
Assert.False(torznabCaps.SupportsImdbMovieSearch);
Assert.False(torznabCaps.SupportsImdbTVSearch);
Assert.False(torznabCaps.SupportsTvdbSearch);
Assert.False(torznabCaps.SupportsTmdbMovieSearch);
Assert.False(torznabCaps.SupportsTVRageSearch);
Assert.AreEqual(0, torznabCaps.SupportedMusicSearchParamsList.Count);
Assert.AreEqual(0, torznabCaps.Categories.Count);
Assert.False(torznabCaps.MovieSearchImdbAvailable);
Assert.False(torznabCaps.MovieSearchTmdbAvailable);
// TODO: movies category enables Movies Search ??
cats = new [] { TorznabCatType.MoviesSD };
torznabCaps = new TorznabCapabilities(cats);
Assert.AreEqual(1, torznabCaps.Categories.Count);
Assert.AreEqual( TorznabCatType.MoviesSD, torznabCaps.Categories[0]);
Assert.True(torznabCaps.MovieSearchAvailable);
Assert.IsEmpty(torznabCaps.SupportedMusicSearchParamsList);
Assert.False(torznabCaps.MusicSearchAvailable); // init
Assert.False(torznabCaps.BookSearchAvailable);
Assert.IsEmpty(torznabCaps.Categories);
}
[Test]
public void TestParseMovieSearchParams()
{
var torznabCaps = new TorznabCapabilities();
torznabCaps.ParseMovieSearchParams(null);
Assert.IsEmpty(torznabCaps.MovieSearchParams);
torznabCaps = new TorznabCapabilities();
torznabCaps.ParseMovieSearchParams(new List<string>());
Assert.IsEmpty(torznabCaps.MovieSearchParams);
torznabCaps = new TorznabCapabilities();
torznabCaps.ParseMovieSearchParams(new List<string> {"q", "imdbid"});
Assert.AreEqual(new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId }, torznabCaps.MovieSearchParams);
torznabCaps = new TorznabCapabilities();
try {
torznabCaps.ParseMovieSearchParams(new List<string> {"q", "q"}); // duplicate param
Assert.Fail();
}
catch (Exception)
{
// ignored
}
torznabCaps = new TorznabCapabilities();
try {
torznabCaps.ParseMovieSearchParams(new List<string> {"bad"}); // unsupported param
Assert.Fail();
}
catch (Exception)
{
// ignored
}
}
[Test]
@ -94,21 +112,19 @@ namespace Jackett.Test.Common.Models
{
SearchAvailable = true,
TVSearchAvailable = true,
MovieSearchAvailable = true,
BookSearchAvailable = true,
SupportsImdbMovieSearch = true,
SupportsImdbTVSearch = true,
SupportsTvdbSearch = true,
SupportsTmdbMovieSearch = true,
SupportsTVRageSearch = true,
SupportedMusicSearchParamsList = new List<string>{"q", "album", "artist", "label", "year"}
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId, MovieSearchParam.TmdbId },
SupportedMusicSearchParamsList = new List<string>{"q", "album", "artist", "label", "year"},
BookSearchAvailable = true
};
xDocument = torznabCaps.GetXDocument();
xDoumentSearching = xDocument.Root?.Element("searching");
Assert.AreEqual("yes", xDoumentSearching?.Element("search")?.Attribute("available")?.Value);
Assert.AreEqual("q", xDoumentSearching?.Element("search")?.Attribute("supportedParams")?.Value);
Assert.AreEqual("yes", xDoumentSearching?.Element("tv-search")?.Attribute("available")?.Value);
Assert.AreEqual("q,season,ep,rid,tvdbid,imdbid", xDoumentSearching?.Element("tv-search")?.Attribute("supportedParams")?.Value);
Assert.AreEqual("q,season,ep,imdbid,tvdbid,rid", xDoumentSearching?.Element("tv-search")?.Attribute("supportedParams")?.Value);
Assert.AreEqual("yes", xDoumentSearching?.Element("movie-search")?.Attribute("available")?.Value);
Assert.AreEqual("q,imdbid,tmdbid", xDoumentSearching?.Element("movie-search")?.Attribute("supportedParams")?.Value);
Assert.AreEqual("yes", xDoumentSearching?.Element("music-search")?.Attribute("available")?.Value);
@ -119,7 +135,10 @@ namespace Jackett.Test.Common.Models
Assert.AreEqual("q,author,title", xDoumentSearching?.Element("book-search")?.Attribute("supportedParams")?.Value);
// test categories
torznabCaps = new TorznabCapabilities(new [] { TorznabCatType.MoviesSD }); // child category
torznabCaps = new TorznabCapabilities
{
Categories = {TorznabCatType.MoviesSD} // child category
};
xDocument = torznabCaps.GetXDocument();
var xDoumentCategories = xDocument.Root?.Element("categories")?.Elements("category").ToList();
Assert.AreEqual(1, xDoumentCategories?.Count);
@ -127,7 +146,10 @@ namespace Jackett.Test.Common.Models
Assert.AreEqual(TorznabCatType.MoviesSD.Name, xDoumentCategories?.First().Attribute("name")?.Value);
// TODO: child category is duplicated. should we add just parent and child without other subcats?
torznabCaps = new TorznabCapabilities(new [] { TorznabCatType.Movies, TorznabCatType.MoviesSD }); // parent and child category
torznabCaps = new TorznabCapabilities
{
Categories = {TorznabCatType.Movies, TorznabCatType.MoviesSD} // parent and child category
};
xDocument = torznabCaps.GetXDocument();
xDoumentCategories = xDocument.Root?.Element("categories")?.Elements("category").ToList();
Assert.AreEqual(2, xDoumentCategories?.Count);
@ -141,12 +163,9 @@ namespace Jackett.Test.Common.Models
Assert.AreEqual(TorznabCatType.MoviesForeign.Name, xDoumentSubCategories?.First().Attribute("name")?.Value);
// TODO: review Torznab spec about custom cats => https://github.com/Sonarr/Sonarr/wiki/Implementing-a-Torznab-indexer#caps-endpoint
// TODO: orderby is not working
torznabCaps = new TorznabCapabilities(new []
{
new TorznabCategory(100001, "CustomCat"),
TorznabCatType.MoviesSD
}); // custom category
torznabCaps = new TorznabCapabilities{
Categories = {new TorznabCategory(100001, "CustomCat"), TorznabCatType.MoviesSD} // custom category
};
xDocument = torznabCaps.GetXDocument();
xDoumentCategories = xDocument.Root?.Element("categories")?.Elements("category").ToList();
Assert.AreEqual(2, xDoumentCategories?.Count);
@ -155,5 +174,8 @@ namespace Jackett.Test.Common.Models
Assert.AreEqual(TorznabCatType.MoviesSD.ID.ToString(), xDoumentCategories?[1].Attribute("id")?.Value);
Assert.AreEqual(TorznabCatType.MoviesSD.Name, xDoumentCategories?[1].Attribute("name")?.Value);
}
// TODO: test concatenation
// TODO: test SupportsCategories
}
}

View File

@ -43,24 +43,22 @@ namespace Jackett.Test.Torznab
Assert.True(TorznabCaps.SearchAvailable);
Assert.True(TorznabCaps.TVSearchAvailable);
Assert.False(TorznabCaps.MovieSearchAvailable);
Assert.False(TorznabCaps.MusicSearchAvailable);
Assert.False(TorznabCaps.BookSearchAvailable);
Assert.False(TorznabCaps.SupportsImdbMovieSearch);
Assert.False(TorznabCaps.SupportsImdbTVSearch);
Assert.False(TorznabCaps.SupportsTvdbSearch);
Assert.False(TorznabCaps.SupportsTmdbMovieSearch);
Assert.False(TorznabCaps.SupportsTVRageSearch);
Assert.AreEqual(0, TorznabCaps.SupportedMusicSearchParamsList.Count);
Assert.IsEmpty(TorznabCaps.MovieSearchParams);
Assert.False(TorznabCaps.MovieSearchAvailable);
Assert.False(TorznabCaps.MovieSearchImdbAvailable);
Assert.False(TorznabCaps.MovieSearchTmdbAvailable);
Assert.IsEmpty(TorznabCaps.SupportedMusicSearchParamsList);
Assert.False(TorznabCaps.MusicSearchAvailable);
Assert.False(TorznabCaps.BookSearchAvailable);
// TODO: movies category enables MovieSearchAvailable but other categories like tv or books don't
// add "int" category (parent category)
AddCategoryMapping(1, TorznabCatType.Movies);
Assert.AreEqual(1, TorznabCaps.Categories.Count);
Assert.AreEqual(2000, TorznabCaps.Categories[0].ID);
Assert.True(TorznabCaps.MovieSearchAvailable);
// add "string" category (child category)
AddCategoryMapping("mov_sd", TorznabCatType.MoviesSD);
Assert.AreEqual(2, TorznabCaps.Categories.Count);
@ -257,15 +255,16 @@ namespace Jackett.Test.Torznab
// TODO: make sure TVSearchAvailable is false by default
Assert.True(indexer.TorznabCaps.SearchAvailable);
Assert.True(indexer.TorznabCaps.TVSearchAvailable);
Assert.False(indexer.TorznabCaps.MovieSearchAvailable);
Assert.False(indexer.TorznabCaps.MusicSearchAvailable);
Assert.False(indexer.TorznabCaps.BookSearchAvailable);
Assert.False(indexer.TorznabCaps.SupportsImdbMovieSearch);
Assert.False(indexer.TorznabCaps.SupportsImdbTVSearch);
Assert.False(indexer.TorznabCaps.SupportsTvdbSearch);
Assert.False(indexer.TorznabCaps.SupportsTmdbMovieSearch);
Assert.False(indexer.TorznabCaps.SupportsTVRageSearch);
Assert.AreEqual(0, indexer.TorznabCaps.SupportedMusicSearchParamsList.Count);
Assert.IsEmpty(indexer.TorznabCaps.MovieSearchParams);
Assert.False(indexer.TorznabCaps.MovieSearchAvailable);
Assert.False(indexer.TorznabCaps.MovieSearchImdbAvailable);
Assert.False(indexer.TorznabCaps.MovieSearchTmdbAvailable);
Assert.IsEmpty(indexer.TorznabCaps.SupportedMusicSearchParamsList);
Assert.False(indexer.TorznabCaps.MusicSearchAvailable);
Assert.False(indexer.TorznabCaps.BookSearchAvailable);
definition = new IndexerDefinition // test categories (same as in C# indexer)
{
@ -305,9 +304,7 @@ namespace Jackett.Test.Torznab
};
indexer = new CardigannIndexer(null, null, null, null, definition);
// TODO: movies category enables MovieSearchAvailable but other categories like tv or books don't
// TODO: test duplicates
Assert.True(indexer.TorznabCaps.MovieSearchAvailable);
Assert.AreEqual(7, indexer.TorznabCaps.Categories.Count);
Assert.AreEqual(2000, indexer.TorznabCaps.Categories[0].ID);
Assert.AreEqual(2030, indexer.TorznabCaps.Categories[1].ID);
@ -339,18 +336,22 @@ namespace Jackett.Test.Torznab
Assert.True(indexer.TorznabCaps.SearchAvailable);
Assert.True(indexer.TorznabCaps.TVSearchAvailable);
// TODO: movie search can't be enabled with the mode, only with movies categories
Assert.False(indexer.TorznabCaps.MovieSearchAvailable);
Assert.True(indexer.TorznabCaps.MusicSearchAvailable);
Assert.True(indexer.TorznabCaps.BookSearchAvailable);
Assert.True(indexer.TorznabCaps.SupportsImdbMovieSearch);
// TODO: this is disabled in Jackett.Common\Indexers\CardigannIndexer.cs : 114
// TODO: SupportsImdbTVSearch is disabled in Jackett.Common\Indexers\CardigannIndexer.cs : 114
Assert.False(indexer.TorznabCaps.SupportsImdbTVSearch);
Assert.True(indexer.TorznabCaps.SupportsTvdbSearch);
Assert.True(indexer.TorznabCaps.SupportsTmdbMovieSearch);
// TODO: TVRage search is not implemented in Cardigann
Assert.False(indexer.TorznabCaps.SupportsTVRageSearch);
Assert.AreEqual(
new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.ImdbId, MovieSearchParam.TmdbId },
indexer.TorznabCaps.MovieSearchParams
);
Assert.True(indexer.TorznabCaps.MovieSearchAvailable);
Assert.True(indexer.TorznabCaps.MovieSearchImdbAvailable);
Assert.True(indexer.TorznabCaps.MovieSearchTmdbAvailable);
// TODO: improve this assert
Assert.AreEqual(5, indexer.TorznabCaps.SupportedMusicSearchParamsList.Count);
Assert.True(indexer.TorznabCaps.MusicSearchAvailable);
Assert.True(indexer.TorznabCaps.BookSearchAvailable);
// test Jackett UI categories (internal JSON) => same code path as C# indexer
// test Torznab caps (XML) => same code path as C# indexer