Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opensubtitles Rate Limit Exceeded #28

Closed
Artiume opened this issue Mar 1, 2020 · 3 comments · Fixed by #54
Closed

Opensubtitles Rate Limit Exceeded #28

Artiume opened this issue Mar 1, 2020 · 3 comments · Fixed by #54

Comments

@Artiume
Copy link

Artiume commented Mar 1, 2020

Opensubtitles will exceed the rate limit of the API.

https://trac.opensubtitles.org/projects/opensubtitles/wiki/XMLRPC
API Request limit: 40 HTTP requests per 10 seconds per IP address

We should also probably integrate the X-ratelimit header to the sources that respect the header.
Check HTTP Response header 'X-RateLimit-Remaining' for http requests remaining per given period.

Might be worth while for this as well
If you get 407 Download limit reached, do not use persistent connections (HTTP keep-alive) and don't download more than 200 subtitles per 24 hour per IP/User

Paid members still have a rate limit
Higher download limits - 1000 subtitles/24 hours - useful when using programs such as media centers (but no abusing!)

@Artiume Artiume changed the title Opensubtitles Rate Limit Opensubtitles Rate Limit Exceeded Mar 1, 2020
@JustAMan JustAMan transferred this issue from jellyfin/jellyfin Mar 2, 2020
@JustAMan
Copy link

JustAMan commented Mar 2, 2020

This feels like the Opensubtitles plugin issue, so I moved it.

@develroo
Copy link

develroo commented Mar 5, 2020

I can confirm that the rate limit does seem to be reset after 24 hours so scheduling it to run every 48 hours means I get at least another 200 subtitles but really it makes my logs a mess with messages like this.


MediaBrowser.Model.Net.HttpException: Too Many Requests
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.EnsureSuccessStatusCode(HttpResponseMessage response, HttpRequestOptions options)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsyncInternal(HttpRequestOptions options, HttpMethod httpMethod)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsync(HttpRequestOptions options, HttpMethod httpMethod)
   at OpenSubtitlesHandler.Utilities.SendRequestAsync(Byte[] request, String userAgent, CancellationToken cancellationToken)
   at OpenSubtitlesHandler.OpenSubtitles.SearchSubtitlesAsync(SubtitleSearchParameters[] parameters, CancellationToken cancellationToken)
   at Jellyfin.Plugin.OpenSubtitles.OpenSubtitleDownloader.Search(SubtitleSearchRequest request, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Subtitles.SubtitleManager.SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)
[04:00:35] [ERR] Error downloading subtitles from Open Subtitles

@dkanada
Copy link
Member

dkanada commented Mar 5, 2020

We should probably stop a scan with no account when this result is returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants