mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-02 00:12:24 +00:00
fixes #2588 - OpenSubtitlesDownloader doesn't respect X-Ratelimit-Requests-Remaining
This commit is contained in:
@@ -136,7 +136,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
|
||||
if ((DateTime.UtcNow - _lastRateLimitException).TotalHours < 1)
|
||||
{
|
||||
throw new Exception("OpenSubtitles rate limit reached");
|
||||
throw new RateLimitExceededException("OpenSubtitles rate limit reached");
|
||||
}
|
||||
|
||||
var resultDownLoad = await OpenSubtitles.DownloadSubtitlesAsync(downloadsList, cancellationToken).ConfigureAwait(false);
|
||||
@@ -144,7 +144,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
if ((resultDownLoad.Status ?? string.Empty).IndexOf("407", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
_lastRateLimitException = DateTime.UtcNow;
|
||||
throw new Exception("OpenSubtitles rate limit reached");
|
||||
throw new RateLimitExceededException("OpenSubtitles rate limit reached");
|
||||
}
|
||||
|
||||
if (!(resultDownLoad is MethodResponseSubtitleDownload))
|
||||
|
||||
Reference in New Issue
Block a user