mirror of
https://github.com/Jackett/Jackett
synced 2025-02-22 14:20:57 +00:00
enable IMDb ID support for AlphaRatio (#6074)
added checking results tags for imdbid on GazelleTracker abstract added searching with imdbid on GazelleTracker abstract via taglist query
This commit is contained in:
parent
fad548cce3
commit
0abc2df38d
2 changed files with 31 additions and 4 deletions
|
@ -23,6 +23,7 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
protected string DownloadUrl { get { return SiteLink + "torrents.php?action=download&usetoken=" + (useTokens ? "1" : "0") + "&id="; } }
|
protected string DownloadUrl { get { return SiteLink + "torrents.php?action=download&usetoken=" + (useTokens ? "1" : "0") + "&id="; } }
|
||||||
protected string DetailsUrl { get { return SiteLink + "torrents.php?torrentid="; } }
|
protected string DetailsUrl { get { return SiteLink + "torrents.php?torrentid="; } }
|
||||||
protected bool supportsFreeleechTokens;
|
protected bool supportsFreeleechTokens;
|
||||||
|
protected bool imdbInTags;
|
||||||
protected bool supportsCategories = true; // set to false if the tracker doesn't include the categories in the API search results
|
protected bool supportsCategories = true; // set to false if the tracker doesn't include the categories in the API search results
|
||||||
protected bool useTokens = false;
|
protected bool useTokens = false;
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
set { base.configData = value; }
|
set { base.configData = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public GazelleTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link, bool supportsFreeleechTokens)
|
public GazelleTracker(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService, string name, string desc, string link, bool supportsFreeleechTokens, bool imdbInTags = false)
|
||||||
: base(name: name,
|
: base(name: name,
|
||||||
description: desc,
|
description: desc,
|
||||||
link: link,
|
link: link,
|
||||||
|
@ -45,6 +46,7 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
{
|
{
|
||||||
Encoding = Encoding.UTF8;
|
Encoding = Encoding.UTF8;
|
||||||
this.supportsFreeleechTokens = supportsFreeleechTokens;
|
this.supportsFreeleechTokens = supportsFreeleechTokens;
|
||||||
|
this.imdbInTags = imdbInTags;
|
||||||
|
|
||||||
if (supportsFreeleechTokens)
|
if (supportsFreeleechTokens)
|
||||||
{
|
{
|
||||||
|
@ -112,7 +114,10 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(query.ImdbID))
|
if (!string.IsNullOrWhiteSpace(query.ImdbID))
|
||||||
{
|
{
|
||||||
queryCollection.Add("cataloguenumber", query.ImdbID);
|
if (this.imdbInTags)
|
||||||
|
queryCollection.Add("taglist", query.ImdbID);
|
||||||
|
else
|
||||||
|
queryCollection.Add("cataloguenumber", query.ImdbID);
|
||||||
}
|
}
|
||||||
else if (!string.IsNullOrWhiteSpace(searchString))
|
else if (!string.IsNullOrWhiteSpace(searchString))
|
||||||
{
|
{
|
||||||
|
@ -183,6 +188,26 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
if (tags != null && tags.Count > 0 && (string)tags[0] != "")
|
if (tags != null && tags.Count > 0 && (string)tags[0] != "")
|
||||||
release.Description += "Tags: " + string.Join(", ", tags) + "\n";
|
release.Description += "Tags: " + string.Join(", ", tags) + "\n";
|
||||||
|
|
||||||
|
if (imdbInTags)
|
||||||
|
{
|
||||||
|
int? currentTagImdbId;
|
||||||
|
// Check if multiple IMDb IDs exist
|
||||||
|
// If they do, show no IMDb link
|
||||||
|
foreach (var tag in tags)
|
||||||
|
{
|
||||||
|
currentTagImdbId = ParseUtil.GetImdbID((string)tag);
|
||||||
|
if (currentTagImdbId != null && release.Imdb == null)
|
||||||
|
{
|
||||||
|
release.Imdb = currentTagImdbId;
|
||||||
|
}
|
||||||
|
else if (currentTagImdbId != null)
|
||||||
|
{
|
||||||
|
release.Imdb = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (r["torrents"] is JArray)
|
if (r["torrents"] is JArray)
|
||||||
{
|
{
|
||||||
foreach (JObject torrent in r["torrents"])
|
foreach (JObject torrent in r["torrents"])
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace Jackett.Common.Indexers
|
||||||
{
|
{
|
||||||
public class AlphaRatio : GazelleTracker
|
public class AlphaRatio : GazelleTracker
|
||||||
{
|
{
|
||||||
public AlphaRatio(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService)
|
public AlphaRatio(IIndexerConfigurationService configService, Utils.Clients.WebClient webClient, Logger logger, IProtectionService protectionService)
|
||||||
: base(name: "AlphaRatio",
|
: base(name: "AlphaRatio",
|
||||||
desc: "AlphaRatio (AR) is a Private Torrent Tracker for 0DAY / GENERAL",
|
desc: "AlphaRatio (AR) is a Private Torrent Tracker for 0DAY / GENERAL",
|
||||||
link: "https://alpharatio.cc/",
|
link: "https://alpharatio.cc/",
|
||||||
|
@ -16,11 +16,13 @@ namespace Jackett.Common.Indexers
|
||||||
logger: logger,
|
logger: logger,
|
||||||
protectionService: protectionService,
|
protectionService: protectionService,
|
||||||
webClient: webClient,
|
webClient: webClient,
|
||||||
supportsFreeleechTokens: true
|
supportsFreeleechTokens: true,
|
||||||
|
imdbInTags: true
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Language = "en-us";
|
Language = "en-us";
|
||||||
Type = "private";
|
Type = "private";
|
||||||
|
TorznabCaps.SupportsImdbMovieSearch = true;
|
||||||
|
|
||||||
AddCategoryMapping(1, TorznabCatType.TVSD, "TvSD");
|
AddCategoryMapping(1, TorznabCatType.TVSD, "TvSD");
|
||||||
AddCategoryMapping(2, TorznabCatType.TVHD, "TvHD");
|
AddCategoryMapping(2, TorznabCatType.TVHD, "TvHD");
|
||||||
|
|
Loading…
Reference in a new issue