mirror of
https://github.com/Jackett/Jackett
synced 2025-02-24 15:21:06 +00:00
Added categories to bB
This commit is contained in:
parent
9a7fe91eb8
commit
001074b101
4 changed files with 35 additions and 10 deletions
|
@ -22,7 +22,7 @@ namespace Jackett.Indexers
|
|||
public class AlphaRatio : BaseIndexer, IIndexer
|
||||
{
|
||||
private string LoginUrl { get { return SiteLink + "login.php"; } }
|
||||
private string SearchUrl { get { return SiteLink + "ajax.php?action=browse&"; } }
|
||||
private string SearchUrl { get { return SiteLink + "ajax.php?action=browse&order_by=time&order_way=desc&"; } }
|
||||
private string DownloadUrl { get { return SiteLink + "torrents.php?action=download&id="; } }
|
||||
private string GuidUrl { get { return SiteLink + "torrents.php?torrentid="; } }
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace Jackett.Indexers
|
|||
AddCategoryMapping(16, TorznabCatType.PC);
|
||||
AddCategoryMapping(17, TorznabCatType.PCMac);
|
||||
AddCategoryMapping(19, TorznabCatType.PCMobileOther);
|
||||
AddCategoryMapping(21, TorznabCatType.EBook);
|
||||
AddCategoryMapping(21, TorznabCatType.EBooks);
|
||||
AddCategoryMapping(22, TorznabCatType.AudioBooks);
|
||||
AddCategoryMapping(23, TorznabCatType.Audio);
|
||||
}
|
||||
|
@ -95,8 +95,6 @@ namespace Jackett.Indexers
|
|||
|
||||
var searchUrl = SearchUrl;
|
||||
var queryCollection = new NameValueCollection();
|
||||
queryCollection.Add("order_by", "time");
|
||||
queryCollection.Add("order_way", "desc");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchString))
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ using System.Text;
|
|||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Jackett.Models.IndexerConfig;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace Jackett.Indexers
|
||||
{
|
||||
|
@ -24,7 +25,7 @@ namespace Jackett.Indexers
|
|||
private string BaseUrl { get { return StringUtil.FromBase64("aHR0cHM6Ly9iYWNvbmJpdHMub3JnLw=="); } }
|
||||
private Uri BaseUri { get { return new Uri(BaseUrl); } }
|
||||
private string LoginUrl { get { return BaseUri + "login.php"; } }
|
||||
private string SearchUrl { get { return BaseUri + "torrents.php?searchstr={0}&searchtags=&tags_type=0&order_by=s3&order_way=desc&disablegrouping=1&filter_cat%5B10%5D=1"; } }
|
||||
private string SearchUrl { get { return BaseUri + "torrents.php?searchtags=&tags_type=0&order_by=s3&order_way=desc&disablegrouping=1&"; } }
|
||||
|
||||
new ConfigurationDataBasicLogin configData
|
||||
{
|
||||
|
@ -43,6 +44,17 @@ namespace Jackett.Indexers
|
|||
p: ps,
|
||||
configData: new ConfigurationDataBasicLogin())
|
||||
{
|
||||
AddCategoryMapping(1, TorznabCatType.Audio);
|
||||
AddCategoryMapping(2, TorznabCatType.PC);
|
||||
AddCategoryMapping(3, TorznabCatType.EBooks);
|
||||
AddCategoryMapping(4, TorznabCatType.AudioBooks);
|
||||
AddCategoryMapping(6, TorznabCatType.Comic);
|
||||
AddCategoryMapping(8, TorznabCatType.Anime);
|
||||
AddCategoryMapping(9, TorznabCatType.Movies);
|
||||
AddCategoryMapping(10, TorznabCatType.TV);
|
||||
AddCategoryMapping(10, TorznabCatType.TVHD);
|
||||
AddCategoryMapping(10, TorznabCatType.TVSD);
|
||||
AddCategoryMapping(11, TorznabCatType.PCGames);
|
||||
}
|
||||
|
||||
public async Task ApplyConfiguration(JToken configJson)
|
||||
|
@ -77,8 +89,23 @@ namespace Jackett.Indexers
|
|||
List<ReleaseInfo> releases = new List<ReleaseInfo>();
|
||||
|
||||
var searchString = query.SanitizedSearchTerm + " " + query.GetEpisodeSearchString();
|
||||
var episodeSearchUrl = string.Format(SearchUrl, HttpUtility.UrlEncode(searchString));
|
||||
var results = await RequestStringWithCookiesAndRetry(episodeSearchUrl);
|
||||
var searchUrl = SearchUrl;
|
||||
var queryCollection = new NameValueCollection();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchString))
|
||||
{
|
||||
queryCollection.Add("searchstr", searchString);
|
||||
}
|
||||
|
||||
foreach (var cat in MapTorznabCapsToTrackers(query))
|
||||
{
|
||||
queryCollection.Add("filter_cat[" + cat + "]", "1");
|
||||
}
|
||||
|
||||
searchUrl += queryCollection.GetQueryString();
|
||||
Console.WriteLine(searchUrl);
|
||||
|
||||
var results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace Jackett.Indexers
|
|||
|
||||
protected virtual void SaveConfig()
|
||||
{
|
||||
indexerService.SaveConfig(this as IIndexer, configData.ToJson(protectionService,forDisplay: false));
|
||||
indexerService.SaveConfig(this as IIndexer, configData.ToJson(protectionService, forDisplay: false));
|
||||
}
|
||||
|
||||
protected void OnParseError(string results, Exception ex)
|
||||
|
@ -390,7 +390,7 @@ namespace Jackett.Indexers
|
|||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return result.Distinct().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace Jackett.Models
|
|||
get { return GetCat(8000); }
|
||||
}
|
||||
|
||||
public static TorznabCategory EBook
|
||||
public static TorznabCategory EBooks
|
||||
{
|
||||
get { return GetCat(7020); }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue