mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Added additional torznab categories, implemented AlphaRatio categories
This commit is contained in:
@@ -15,13 +15,14 @@ using NLog;
|
|||||||
using Jackett.Services;
|
using Jackett.Services;
|
||||||
using Jackett.Utils.Clients;
|
using Jackett.Utils.Clients;
|
||||||
using Jackett.Models.IndexerConfig;
|
using Jackett.Models.IndexerConfig;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
namespace Jackett.Indexers
|
namespace Jackett.Indexers
|
||||||
{
|
{
|
||||||
public class AlphaRatio : BaseIndexer, IIndexer
|
public class AlphaRatio : BaseIndexer, IIndexer
|
||||||
{
|
{
|
||||||
private string LoginUrl { get { return SiteLink + "login.php"; } }
|
private string LoginUrl { get { return SiteLink + "login.php"; } }
|
||||||
private string SearchUrl { get { return SiteLink + "ajax.php?action=browse&searchstr="; } }
|
private string SearchUrl { get { return SiteLink + "ajax.php?action=browse&"; } }
|
||||||
private string DownloadUrl { get { return SiteLink + "torrents.php?action=download&id="; } }
|
private string DownloadUrl { get { return SiteLink + "torrents.php?action=download&id="; } }
|
||||||
private string GuidUrl { get { return SiteLink + "torrents.php?torrentid="; } }
|
private string GuidUrl { get { return SiteLink + "torrents.php?torrentid="; } }
|
||||||
|
|
||||||
@@ -36,7 +37,22 @@ namespace Jackett.Indexers
|
|||||||
p: ps,
|
p: ps,
|
||||||
configData: new ConfigurationDataBasicLogin())
|
configData: new ConfigurationDataBasicLogin())
|
||||||
{
|
{
|
||||||
webclient = w;
|
AddCategoryMapping(1, TorznabCatType.TVSD);
|
||||||
|
AddCategoryMapping(2, TorznabCatType.TVHD);
|
||||||
|
AddCategoryMapping(6, TorznabCatType.MoviesSD);
|
||||||
|
AddCategoryMapping(7, TorznabCatType.MoviesHD);
|
||||||
|
AddCategoryMapping(10, TorznabCatType.XXX);
|
||||||
|
AddCategoryMapping(20, TorznabCatType.XXX);
|
||||||
|
AddCategoryMapping(12, TorznabCatType.PCGames);
|
||||||
|
AddCategoryMapping(13, TorznabCatType.GameXbox);
|
||||||
|
AddCategoryMapping(14, TorznabCatType.GamePS3);
|
||||||
|
AddCategoryMapping(15, TorznabCatType.GameWii);
|
||||||
|
AddCategoryMapping(16, TorznabCatType.PC);
|
||||||
|
AddCategoryMapping(17, TorznabCatType.PCMac);
|
||||||
|
AddCategoryMapping(19, TorznabCatType.PCMobileOther);
|
||||||
|
AddCategoryMapping(21, TorznabCatType.EBook);
|
||||||
|
AddCategoryMapping(22, TorznabCatType.AudioBooks);
|
||||||
|
AddCategoryMapping(23, TorznabCatType.Audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ApplyConfiguration(JToken configJson)
|
public async Task ApplyConfiguration(JToken configJson)
|
||||||
@@ -76,8 +92,24 @@ namespace Jackett.Indexers
|
|||||||
{
|
{
|
||||||
var releases = new List<ReleaseInfo>();
|
var releases = new List<ReleaseInfo>();
|
||||||
var searchString = query.SanitizedSearchTerm + " " + query.GetEpisodeSearchString();
|
var searchString = query.SanitizedSearchTerm + " " + query.GetEpisodeSearchString();
|
||||||
var episodeSearchUrl = SearchUrl + HttpUtility.UrlEncode(searchString);
|
|
||||||
var response = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
|
var searchUrl = SearchUrl;
|
||||||
|
var queryCollection = new NameValueCollection();
|
||||||
|
queryCollection.Add("order_by", "time");
|
||||||
|
queryCollection.Add("order_way", "desc");
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(searchString))
|
||||||
|
{
|
||||||
|
queryCollection.Add("searchstr", searchString);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var cat in MapTorznabCapsToTrackers(query))
|
||||||
|
{
|
||||||
|
queryCollection.Add("filter_cat[" + cat + "]", "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
searchUrl += queryCollection.GetQueryString();
|
||||||
|
var response = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@@ -116,7 +116,6 @@ namespace Jackett.Indexers
|
|||||||
var releases = new List<ReleaseInfo>();
|
var releases = new List<ReleaseInfo>();
|
||||||
var searchString = query.SanitizedSearchTerm + " " + query.GetEpisodeSearchString();
|
var searchString = query.SanitizedSearchTerm + " " + query.GetEpisodeSearchString();
|
||||||
var searchUrl = BrowseUrl;
|
var searchUrl = BrowseUrl;
|
||||||
var trackerCats = MapTorznabCapsToTrackers(query);
|
|
||||||
var queryCollection = new NameValueCollection();
|
var queryCollection = new NameValueCollection();
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(searchString))
|
if (!string.IsNullOrWhiteSpace(searchString))
|
||||||
|
@@ -37,13 +37,13 @@ namespace Jackett.Models
|
|||||||
|
|
||||||
public static bool QueryContainsParentCategory(int[] queryCats, int releaseCat)
|
public static bool QueryContainsParentCategory(int[] queryCats, int releaseCat)
|
||||||
{
|
{
|
||||||
if (cats.ContainsKey(releaseCat) && queryCats!=null)
|
if (cats.ContainsKey(releaseCat) && queryCats != null)
|
||||||
{
|
{
|
||||||
var ncab = cats[releaseCat];
|
var ncab = cats[releaseCat];
|
||||||
var split = ncab.IndexOf("/");
|
var split = ncab.IndexOf("/");
|
||||||
if (split > -1)
|
if (split > -1)
|
||||||
{
|
{
|
||||||
string parentCatName = ncab.Substring(0,split);
|
string parentCatName = ncab.Substring(0, split);
|
||||||
if (cats.ContainsValue(parentCatName))
|
if (cats.ContainsValue(parentCatName))
|
||||||
{
|
{
|
||||||
var parentCat = cats.Where(c => c.Value == parentCatName).First().Key;
|
var parentCat = cats.Where(c => c.Value == parentCatName).First().Key;
|
||||||
@@ -70,7 +70,7 @@ namespace Jackett.Models
|
|||||||
return new TorznabCategory()
|
return new TorznabCategory()
|
||||||
{
|
{
|
||||||
ID = id,
|
ID = id,
|
||||||
Name = cats[id]
|
Name = cats.ContainsKey(id) ? cats[id] : string.Empty
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,11 +99,26 @@ namespace Jackett.Models
|
|||||||
get { return GetCat(5040); }
|
get { return GetCat(5040); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory TVSport
|
||||||
|
{
|
||||||
|
get { return GetCat(5060); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory TVForeign
|
||||||
|
{
|
||||||
|
get { return GetCat(5020); }
|
||||||
|
}
|
||||||
|
|
||||||
public static TorznabCategory Books
|
public static TorznabCategory Books
|
||||||
{
|
{
|
||||||
get { return GetCat(8000); }
|
get { return GetCat(8000); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory EBook
|
||||||
|
{
|
||||||
|
get { return GetCat(7020); }
|
||||||
|
}
|
||||||
|
|
||||||
public static TorznabCategory Comic
|
public static TorznabCategory Comic
|
||||||
{
|
{
|
||||||
get { return GetCat(8020); }
|
get { return GetCat(8020); }
|
||||||
@@ -114,21 +129,21 @@ namespace Jackett.Models
|
|||||||
get { return GetCat(4000); }
|
get { return GetCat(4000); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TorznabCategory PCGames
|
|
||||||
{
|
|
||||||
get { return GetCat(4050); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TorznabCategory AudioBooks
|
|
||||||
{
|
|
||||||
get { return GetCat(3030); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TorznabCategory Movies
|
public static TorznabCategory Movies
|
||||||
{
|
{
|
||||||
get { return GetCat(2000); }
|
get { return GetCat(2000); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory MoviesForeign
|
||||||
|
{
|
||||||
|
get { return GetCat(2010); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory MoviesOther
|
||||||
|
{
|
||||||
|
get { return GetCat(2020); }
|
||||||
|
}
|
||||||
|
|
||||||
public static TorznabCategory MoviesHD
|
public static TorznabCategory MoviesHD
|
||||||
{
|
{
|
||||||
get { return GetCat(2040); }
|
get { return GetCat(2040); }
|
||||||
@@ -139,9 +154,14 @@ namespace Jackett.Models
|
|||||||
get { return GetCat(2030); }
|
get { return GetCat(2030); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TorznabCategory MoviesForeign
|
public static TorznabCategory MoviesBlueRay
|
||||||
{
|
{
|
||||||
get { return GetCat(2040); }
|
get { return GetCat(2050); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory Movies3D
|
||||||
|
{
|
||||||
|
get { return GetCat(2060); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TorznabCategory Audio
|
public static TorznabCategory Audio
|
||||||
@@ -149,6 +169,11 @@ namespace Jackett.Models
|
|||||||
get { return GetCat(3000); }
|
get { return GetCat(3000); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory AudioBooks
|
||||||
|
{
|
||||||
|
get { return GetCat(3030); }
|
||||||
|
}
|
||||||
|
|
||||||
public static TorznabCategory AudioLossless
|
public static TorznabCategory AudioLossless
|
||||||
{
|
{
|
||||||
get { return GetCat(3040); }
|
get { return GetCat(3040); }
|
||||||
@@ -178,5 +203,75 @@ namespace Jackett.Models
|
|||||||
{
|
{
|
||||||
get { return GetCat(6060); }
|
get { return GetCat(6060); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PC
|
||||||
|
{
|
||||||
|
get { return GetCat(4000); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PC0Day
|
||||||
|
{
|
||||||
|
get { return GetCat(4010); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PCIso
|
||||||
|
{
|
||||||
|
get { return GetCat(4020); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PCMac
|
||||||
|
{
|
||||||
|
get { return GetCat(4030); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PCGames
|
||||||
|
{
|
||||||
|
get { return GetCat(4050); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PCMobileOther
|
||||||
|
{
|
||||||
|
get { return GetCat(4040); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PCMobileIos
|
||||||
|
{
|
||||||
|
get { return GetCat(4060); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory PCMobileAndroid
|
||||||
|
{
|
||||||
|
get { return GetCat(4070); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory GameDNS
|
||||||
|
{
|
||||||
|
get { return GetCat(1010); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory GamePSP
|
||||||
|
{
|
||||||
|
get { return GetCat(1020); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory GameXbox
|
||||||
|
{
|
||||||
|
get { return GetCat(1040); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory GameXbox360
|
||||||
|
{
|
||||||
|
get { return GetCat(1050); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory GameWii
|
||||||
|
{
|
||||||
|
get { return GetCat(1030); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TorznabCategory GamePS3
|
||||||
|
{
|
||||||
|
get { return GetCat(1080); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user