mirror of https://github.com/Jackett/Jackett
parent
a0659f1ca6
commit
a9feb22e6d
|
@ -29,6 +29,7 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
protected virtual string PosterUrl => SiteLink;
|
protected virtual string PosterUrl => SiteLink;
|
||||||
protected virtual string AuthorizationFormat => "{0}";
|
protected virtual string AuthorizationFormat => "{0}";
|
||||||
protected virtual int ApiKeyLength => 41;
|
protected virtual int ApiKeyLength => 41;
|
||||||
|
protected virtual string FlipOptionalTokenString(string requestLink) => requestLink.Replace("usetoken=1", "usetoken=0");
|
||||||
|
|
||||||
protected bool useTokens;
|
protected bool useTokens;
|
||||||
protected string cookie = "";
|
protected string cookie = "";
|
||||||
|
@ -395,10 +396,11 @@ namespace Jackett.Common.Indexers.Abstract
|
||||||
var html = Encoding.GetString(content);
|
var html = Encoding.GetString(content);
|
||||||
if (html.Contains("You do not have any freeleech tokens left.")
|
if (html.Contains("You do not have any freeleech tokens left.")
|
||||||
|| html.Contains("You do not have enough freeleech tokens")
|
|| html.Contains("You do not have enough freeleech tokens")
|
||||||
|| html.Contains("This torrent is too large."))
|
|| html.Contains("This torrent is too large.")
|
||||||
|
|| html.Contains("You cannot use tokens here"))
|
||||||
{
|
{
|
||||||
// download again with usetoken=0
|
// download again with usetoken=0
|
||||||
var requestLinkNew = requestLink.Replace("usetoken=1", "usetoken=0");
|
var requestLinkNew = FlipOptionalTokenString(requestLink);
|
||||||
content = await base.Download(new Uri(requestLinkNew), RequestType.GET, headers: headers);
|
content = await base.Download(new Uri(requestLinkNew), RequestType.GET, headers: headers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Jackett.Common.Indexers.Abstract;
|
using Jackett.Common.Indexers.Abstract;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
using Jackett.Common.Services.Interfaces;
|
using Jackett.Common.Services.Interfaces;
|
||||||
|
@ -12,9 +14,10 @@ namespace Jackett.Common.Indexers
|
||||||
public class Orpheus : GazelleTracker
|
public class Orpheus : GazelleTracker
|
||||||
{
|
{
|
||||||
// API Reference: https://github.com/OPSnet/Gazelle/wiki/JSON-API-Documentation
|
// API Reference: https://github.com/OPSnet/Gazelle/wiki/JSON-API-Documentation
|
||||||
protected override string DownloadUrl => SiteLink + "ajax.php?action=download&usetoken=" + (useTokens ? "1" : "0") + "&id=";
|
protected override string DownloadUrl => SiteLink + "ajax.php?action=download" + (useTokens ? "&usetoken=1" : "") + "&id=";
|
||||||
protected override string AuthorizationFormat => "token {0}";
|
protected override string AuthorizationFormat => "token {0}";
|
||||||
protected override int ApiKeyLength => 118;
|
protected override int ApiKeyLength => 118;
|
||||||
|
protected override string FlipOptionalTokenString(string requestLink) => requestLink.Replace("usetoken=1", "");
|
||||||
public Orpheus(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
public Orpheus(IIndexerConfigurationService configService, WebClient wc, Logger l, IProtectionService ps,
|
||||||
ICacheService cs)
|
ICacheService cs)
|
||||||
: base(id: "orpheus",
|
: base(id: "orpheus",
|
||||||
|
|
Loading…
Reference in New Issue