mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Implemented Strike categories
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Jackett.Indexers
|
|||||||
: base(name: "bB",
|
: base(name: "bB",
|
||||||
description: "bB",
|
description: "bB",
|
||||||
link: "http://www.reddit.com/r/baconbits/",
|
link: "http://www.reddit.com/r/baconbits/",
|
||||||
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
|
caps: new TorznabCapabilities(),
|
||||||
manager: i,
|
manager: i,
|
||||||
client: w,
|
client: w,
|
||||||
logger: l,
|
logger: l,
|
||||||
|
@@ -91,7 +91,7 @@ namespace Jackett.Indexers
|
|||||||
if (null != input)
|
if (null != input)
|
||||||
{
|
{
|
||||||
input = input.ToLowerInvariant();
|
input = input.ToLowerInvariant();
|
||||||
var mapping = categoryMapping.Where(m => m.TrackerCategory == input).FirstOrDefault();
|
var mapping = categoryMapping.Where(m => m.TrackerCategory.ToLowerInvariant() == input.ToLowerInvariant()).FirstOrDefault();
|
||||||
if (mapping != null)
|
if (mapping != null)
|
||||||
{
|
{
|
||||||
return mapping.NewzNabCategory;
|
return mapping.NewzNabCategory;
|
||||||
|
@@ -33,7 +33,7 @@ namespace Jackett.Indexers
|
|||||||
: base(name: "BeyondHD",
|
: base(name: "BeyondHD",
|
||||||
description: "Without BeyondHD, your HDTV is just a TV",
|
description: "Without BeyondHD, your HDTV is just a TV",
|
||||||
link: "https://beyondhd.me/",
|
link: "https://beyondhd.me/",
|
||||||
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
|
caps: new TorznabCapabilities(),
|
||||||
manager: i,
|
manager: i,
|
||||||
client: w,
|
client: w,
|
||||||
logger: l,
|
logger: l,
|
||||||
|
@@ -35,7 +35,7 @@ namespace Jackett.Indexers
|
|||||||
: base(name: "BIT-HDTV",
|
: base(name: "BIT-HDTV",
|
||||||
description: "Home of high definition invites",
|
description: "Home of high definition invites",
|
||||||
link: "https://www.bit-hdtv.com/",
|
link: "https://www.bit-hdtv.com/",
|
||||||
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
|
caps: new TorznabCapabilities(),
|
||||||
manager: i,
|
manager: i,
|
||||||
client: w,
|
client: w,
|
||||||
logger: l,
|
logger: l,
|
||||||
|
@@ -312,7 +312,7 @@ namespace Jackett.Indexers
|
|||||||
if (null != input)
|
if (null != input)
|
||||||
{
|
{
|
||||||
input = input.ToLowerInvariant();
|
input = input.ToLowerInvariant();
|
||||||
var mapping = resultMapping.Where(m => m.TrackerCategory == input).FirstOrDefault();
|
var mapping = resultMapping.Where(m => m.TrackerCategory.ToLowerInvariant() == input.ToLowerInvariant()).FirstOrDefault();
|
||||||
if (mapping != null)
|
if (mapping != null)
|
||||||
{
|
{
|
||||||
return mapping.NewzNabCategory;
|
return mapping.NewzNabCategory;
|
||||||
|
@@ -14,6 +14,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using Jackett.Models.IndexerConfig;
|
using Jackett.Models.IndexerConfig;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
namespace Jackett.Indexers
|
namespace Jackett.Indexers
|
||||||
{
|
{
|
||||||
@@ -27,7 +28,7 @@ namespace Jackett.Indexers
|
|||||||
set { configData.Url.Value = value.ToString(); }
|
set { configData.Url.Value = value.ToString(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SearchUrl { get { return BaseUri + "api/v2/torrents/search/?category=TV&phrase={0}"; } }
|
private string SearchUrl { get { return BaseUri + "api/v2/torrents/search/?phrase={0}"; } }
|
||||||
private string DownloadUrl { get { return BaseUri + "torrents/api/download/{0}.torrent"; } }
|
private string DownloadUrl { get { return BaseUri + "torrents/api/download/{0}.torrent"; } }
|
||||||
|
|
||||||
new ConfigurationDataStrike configData
|
new ConfigurationDataStrike configData
|
||||||
@@ -41,13 +42,34 @@ namespace Jackett.Indexers
|
|||||||
: base(name: "Strike",
|
: base(name: "Strike",
|
||||||
description: "Torrent search engine",
|
description: "Torrent search engine",
|
||||||
link: defaultSiteLink,
|
link: defaultSiteLink,
|
||||||
caps: TorznabUtil.CreateDefaultTorznabTVCaps(),
|
caps: new TorznabCapabilities(),
|
||||||
manager: i,
|
manager: i,
|
||||||
client: wc,
|
client: wc,
|
||||||
logger: l,
|
logger: l,
|
||||||
p: ps,
|
p: ps,
|
||||||
configData: new ConfigurationDataStrike(defaultSiteLink))
|
configData: new ConfigurationDataStrike(defaultSiteLink))
|
||||||
{
|
{
|
||||||
|
AddCategoryMapping("Anime", TorznabCatType.TVAnime);
|
||||||
|
AddCategoryMapping("Applications", TorznabCatType.PC);
|
||||||
|
AddCategoryMapping("Books", TorznabCatType.Books);
|
||||||
|
AddCategoryMapping("Games", TorznabCatType.PCGames);
|
||||||
|
AddCategoryMapping("Movies", TorznabCatType.Movies);
|
||||||
|
AddCategoryMapping("TV", TorznabCatType.TV);
|
||||||
|
AddCategoryMapping("XXX", TorznabCatType.XXX);
|
||||||
|
AddCategoryMapping("Music", TorznabCatType.Audio);
|
||||||
|
|
||||||
|
/*AddCategoryMapping("Movies:Highres Movies", TorznabCatType.MoviesHD);
|
||||||
|
AddCategoryMapping("Movies:3D Movies", TorznabCatType.Movies3D);
|
||||||
|
AddCategoryMapping("Books:Ebooks", TorznabCatType.BooksEbook);
|
||||||
|
AddCategoryMapping("Books:Comics", TorznabCatType.BooksComics);
|
||||||
|
AddCategoryMapping("Books:Audio Books", TorznabCatType.AudioAudiobook);
|
||||||
|
AddCategoryMapping("Games:XBOX360", TorznabCatType.ConsoleXbox360);
|
||||||
|
AddCategoryMapping("Games:Wii", TorznabCatType.ConsoleWii);
|
||||||
|
AddCategoryMapping("Games:PSP", TorznabCatType.ConsolePSP);
|
||||||
|
AddCategoryMapping("Games:PS3", TorznabCatType.ConsolePS3);
|
||||||
|
AddCategoryMapping("Games:PC", TorznabCatType.PCGames);
|
||||||
|
AddCategoryMapping("Games:Android", TorznabCatType.PCPhoneAndroid);
|
||||||
|
AddCategoryMapping("Music:Mp3", TorznabCatType.AudioMP3);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
public async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||||
@@ -83,6 +105,15 @@ namespace Jackett.Indexers
|
|||||||
var queryString = query.GetQueryString();
|
var queryString = query.GetQueryString();
|
||||||
var searchTerm = string.IsNullOrEmpty(queryString) ? DateTime.Now.Year.ToString() : queryString;
|
var searchTerm = string.IsNullOrEmpty(queryString) ? DateTime.Now.Year.ToString() : queryString;
|
||||||
var episodeSearchUrl = string.Format(SearchUrl, HttpUtility.UrlEncode(searchTerm));
|
var episodeSearchUrl = string.Format(SearchUrl, HttpUtility.UrlEncode(searchTerm));
|
||||||
|
|
||||||
|
var trackerCategories = MapTorznabCapsToTrackers(query, mapChildrenCatsToParent: true);
|
||||||
|
|
||||||
|
// This tracker can only search one cat at a time, otherwise search all and filter results
|
||||||
|
if (trackerCategories.Count == 1)
|
||||||
|
{
|
||||||
|
episodeSearchUrl += "&category=" + trackerCategories[0];
|
||||||
|
}
|
||||||
|
|
||||||
var results = await RequestStringWithCookiesAndRetry(episodeSearchUrl, string.Empty);
|
var results = await RequestStringWithCookiesAndRetry(episodeSearchUrl, string.Empty);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -94,6 +125,12 @@ namespace Jackett.Indexers
|
|||||||
release.MinimumRatio = 1;
|
release.MinimumRatio = 1;
|
||||||
release.MinimumSeedTime = 172800;
|
release.MinimumSeedTime = 172800;
|
||||||
|
|
||||||
|
if (trackerCategories.Count > 0 && !trackerCategories.Contains((string)result["torrent_category"]))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
release.Category = MapTrackerCatToNewznab((string)result["torrent_category"]);
|
||||||
|
|
||||||
release.Title = (string)result["torrent_title"];
|
release.Title = (string)result["torrent_title"];
|
||||||
release.Description = release.Title;
|
release.Description = release.Title;
|
||||||
release.Seeders = (int)result["seeds"];
|
release.Seeders = (int)result["seeds"];
|
||||||
|
@@ -10,7 +10,7 @@ namespace Jackett.Models
|
|||||||
{
|
{
|
||||||
public CategoryMapping(string trackerCat, int newzCat)
|
public CategoryMapping(string trackerCat, int newzCat)
|
||||||
{
|
{
|
||||||
TrackerCategory = trackerCat.ToLowerInvariant();
|
TrackerCategory = trackerCat;
|
||||||
NewzNabCategory = newzCat;
|
NewzNabCategory = newzCat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user