diff --git a/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs b/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs index a0316a18b..6d68c8829 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Orpheus.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; 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 @@ -50,5 +51,34 @@ namespace NzbDrone.Core.Indexers.Definitions return caps; } + + public override IParseIndexerResponse GetParser() + { + return new OrpheusParser(Settings, Capabilities); + } + } + + public class OrpheusParser : GazelleParser + { + public OrpheusParser(GazelleSettings settings, IndexerCapabilities capabilities) + : base(settings, capabilities) + { + } + + protected override string GetDownloadUrl(int torrentId) + { + var url = new HttpUri(_settings.BaseUrl) + .CombinePath("/torrents.php") + .AddQueryParam("action", "download") + .AddQueryParam("id", torrentId); + + // Orpheus fails to download if usetoken=0 so we need to only add if we will use one + if (_settings.UseFreeleechToken) + { + url.AddQueryParam("useToken", "1"); + } + + return url.FullUri; + } } }