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

Last.FM returned an error: Rate Limit Exceeded #3207

Open
ChaosBlades opened this issue May 9, 2019 · 14 comments
Open

Last.FM returned an error: Rate Limit Exceeded #3207

ChaosBlades opened this issue May 9, 2019 · 14 comments

Comments

@ChaosBlades
Copy link

Last.FM returned an error: Rate Limit Exceeded - This application has made too many requests in a short period. If this is your API key, see https://www.last.fm/api/tos#4.4 for information about raising the limit.

I just added two artists and it didn't add either of their artwork. So I am pretty sure I didn't hit the rate limit. Doesn't look like this issue has been posted yet but everyone that uses Headphones should be getting it.

@nonamethanks
Copy link

Can confirm, last.fm is not fetching any image for me.

@rantanlan
Copy link

@nine13tech
Copy link

We could change this to take an API key from the config file instead of the apps' hard-coded API key in https://github.com/rembo10/headphones/blob/master/headphones/lastfm.py I'll see if I can work on a rudimentary fix for this and have it pull from the ini file.

@rantanlan
Copy link

rantanlan commented May 29, 2019

I already tried to add my own api key, but the issue stays the same. But I'm no coder by any means... so not sure.

@ChaosBlades
Copy link
Author

Last.fm has completely removed the ability to pull artwork via the API. Check out the link in the second reply.

@nine13tech
Copy link

Upon deeper inspection (yes - artwork is not pullable now) we are violating the number of requests per minute per IP. so an API key issue is not really the thing, it's the number of time we are asking for something per second.
I get why they did this, there are other options out there like muzicbrains, I will look today at what some of the others are using - like Lidarr ( if I can wade through the C# :| )
Sorry for GitHubbing prior to coffee.

@ChaosBlades
Copy link
Author

Not exactly. They removed it period. For everyone regardless of how many calls. The error message is missleading.

"While we allow API users to have access to a lot of data through the API, it has always been against our API Terms of Use for third parties to use audio, audiovisual, images or artwork. In some instances, some data may have been indirectly accessible through a small number of API calls, and so as part of the recent API clean-up, we have corrected that anomaly."

@nine13tech
Copy link

ChaosBlades, sorry I was not more clear - yes they removed a number of things from the API, including album artwork. That said, your assumption that because the artwork is missing from the JSON payload that we are getting a rate limit error is not quite correct. In the LastFM.py code we make a call to the API for as much data as we can get our greedy little paws on; artwork included (which fails). I suspect (but have not verified in the code) that upon failure to have the artwork, we are then retrying, multiple times for different albums, and thusly hitting the 5 calls per minute limit (or whatever it really is now since I can't find that posted anywhere) and now we get what we are perceiving as a failed call that is because the artwork is missing. As you can see in this log, there are a number of successful calls to the API before I get rate limited.

29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-6 : Last.FM call parameters: {'mbid': u'6cb79cb2-9087-44d4-828b-5c6fdff2c957', 'api_key': ‘***’, 'method': 'artist.getinfo', 'format': 'json'}
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-6 : Requesting URL via GET method: http://ws.audioscrobbler.com/2.0/
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-5 : Calling Last.FM method: artist.getinfo
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-5 : Last.FM call parameters: {'mbid': u'23ff8908-e8b1-4ad3-a7c7-7e7dc2f6d720', 'api_key': ‘***’, 'method': 'artist.getinfo', 'format': 'json'}
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-3 : Calling Last.FM method: artist.getinfo
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-3 : Last.FM call parameters: {'mbid': u'a8806b5c-3ee0-4277-94d3-1a5427a7707c', 'api_key': ‘***’, 'method': 'artist.getinfo', 'format': 'json'}
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-11 : Calling Last.FM method: artist.getinfo
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-2 : Calling Last.FM method: artist.getinfo
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-11 : Last.FM call parameters: {'mbid': u'3d679013-6b88-4132-ab35-d5bb4a3583fc', 'api_key': ‘***’, 'method': 'artist.getinfo', 'format': 'json'}
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-8 : Calling Last.FM method: artist.getinfo
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-8 : Last.FM call parameters: {'mbid': u'77a8f9af-f966-45d0-8bb4-b0fe3b8c339b', 'api_key': ‘***’, 'method': 'artist.getinfo', 'format': 'json'}
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-2 : Last.FM call parameters: {'mbid': u'3837fbf1-195d-4d06-8864-ee67b3f10fb3', 'api_key': ‘***’, 'method': 'artist.getinfo', 'format': 'json'}
29-May-2019 07:41:18 - DEBUG   :: CP Server Thread-6 : Last.FM returned an error: Rate Limit Exceeded - This application has made too many requests in a short period. If this is your API key, see https://www.last.fm/api/tos#4.4 for information about raising the limit.```

@nopoz
Copy link
Contributor

nopoz commented Jun 14, 2019

I've submitted a pull request that fixes this by switching artwork lookups to fanart.tv - #3214

@AdeHub
Copy link
Collaborator

AdeHub commented Jun 22, 2019

If I change the API key then the only thing not working for me is Artist Image, everything else including Album image seems ok

@dmrazor
Copy link

dmrazor commented Aug 14, 2019

Any progress on this change? Nopoz edit seems to have failed testing

@AdeHub
Copy link
Collaborator

AdeHub commented Aug 16, 2019

Try the develop branch

@nine13tech
Copy link

nine13tech commented Aug 20, 2019 via email

@rantanlan
Copy link

just tried his fork and its fine regarding metadata, but while switching rlses i get an error...

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

No branches or pull requests

7 participants