mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-15 21:14:32 +01:00
parent
4ec8ea0e4d
commit
4d129ada95
3 changed files with 31 additions and 7 deletions
|
|
@ -11,9 +11,9 @@ namespace NzbDrone.Core.Indexers.Gazelle
|
|||
{
|
||||
public class GazelleParser : IParseIndexerResponse
|
||||
{
|
||||
private readonly GazelleSettings _settings;
|
||||
private readonly IndexerCapabilities _capabilities;
|
||||
private readonly string _baseUrl;
|
||||
protected readonly GazelleSettings _settings;
|
||||
protected readonly IndexerCapabilities _capabilities;
|
||||
protected readonly string _baseUrl;
|
||||
|
||||
public GazelleParser(GazelleSettings settings, IndexerCapabilities capabilities, string baseUrl)
|
||||
{
|
||||
|
|
@ -138,11 +138,12 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||
.ToArray();
|
||||
}
|
||||
|
||||
private string GetDownloadUrl(int torrentId)
|
||||
protected virtual string GetDownloadUrl(int torrentId)
|
||||
{
|
||||
var url = new HttpUri(_baseUrl)
|
||||
.CombinePath("/torrents.php")
|
||||
.AddQueryParam("action", "download")
|
||||
.AddQueryParam("useToken", _settings.UseFreeleechToken ? "1" : "0")
|
||||
.AddQueryParam("id", torrentId);
|
||||
|
||||
return url.FullUri;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ public class GazelleRequestGenerator : IIndexerRequestGenerator
|
|||
public Logger Logger { get; set; }
|
||||
|
||||
protected virtual string APIUrl => BaseUrl + "ajax.php";
|
||||
protected virtual string DownloadUrl => BaseUrl + "torrents.php?action=download&usetoken=" + (Settings.UseFreeleechToken ? "1" : "0") + "&id=";
|
||||
protected virtual string DetailsUrl => BaseUrl + "torrents.php?torrentid=";
|
||||
protected virtual bool ImdbInTags => false;
|
||||
|
||||
public Func<IDictionary<string, string>> GetCookies { get; set; }
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using NLog;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Indexers.Gazelle;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions
|
||||
|
|
@ -49,5 +50,29 @@ protected override IndexerCapabilities SetCapabilities()
|
|||
|
||||
return caps;
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
{
|
||||
return new OrpheusParser(Settings, Capabilities, BaseUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class OrpheusParser : GazelleParser
|
||||
{
|
||||
public OrpheusParser(GazelleSettings settings, IndexerCapabilities capabilities, string baseUrl)
|
||||
: base(settings, capabilities, baseUrl)
|
||||
{
|
||||
}
|
||||
|
||||
protected override string GetDownloadUrl(int torrentId)
|
||||
{
|
||||
var url = new HttpUri(_baseUrl)
|
||||
.CombinePath("/ajax.php")
|
||||
.AddQueryParam("action", "download")
|
||||
.AddQueryParam("useToken", _settings.UseFreeleechToken ? "1" : "0")
|
||||
.AddQueryParam("id", torrentId);
|
||||
|
||||
return url.FullUri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue