Fixed: Orpheus failing to grab if token is not used

Closes #592
pull/605/head
bakerboy448 3 years ago committed by Qstick
parent eccd72304c
commit 1aa9149866

@ -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;
}
}
}

Loading…
Cancel
Save