mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-09 04:22:30 +01:00
Updated Rarbg to use ratelimit service.
This commit is contained in:
parent
78ade3250c
commit
75a50b83fb
@ -17,6 +17,7 @@ public class Rarbg : HttpIndexerBase<RarbgSettings>
|
|||||||
public override string Name { get { return "Rarbg"; } }
|
public override string Name { get { return "Rarbg"; } }
|
||||||
|
|
||||||
public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } }
|
public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } }
|
||||||
|
public override TimeSpan RateLimit { get { return TimeSpan.FromSeconds(10); } }
|
||||||
|
|
||||||
public Rarbg(IRarbgTokenProvider tokenProvider, IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
|
public Rarbg(IRarbgTokenProvider tokenProvider, IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||||
: base(httpClient, configService, parsingService, logger)
|
: base(httpClient, configService, parsingService, logger)
|
||||||
@ -33,18 +34,5 @@ public override IParseIndexerResponse GetParser()
|
|||||||
{
|
{
|
||||||
return new RarbgParser();
|
return new RarbgParser();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IList<ReleaseInfo> FetchPage(IndexerRequest request, IParseIndexerResponse parser)
|
|
||||||
{
|
|
||||||
var delay = _lastFetch + TimeSpan.FromSeconds(10) - DateTime.UtcNow;
|
|
||||||
if (delay.TotalSeconds > 0)
|
|
||||||
{
|
|
||||||
Thread.Sleep(delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
_lastFetch = DateTime.UtcNow;
|
|
||||||
|
|
||||||
return base.FetchPage(request, parser);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user