LaurentCR / pylast

Automatically exported from code.google.com/p/pylast
Apache License 2.0
0 stars 0 forks source link

get_tags() method throws 'Invalid method signature supplied' exception #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The get_tags() method throws an "Invalid method signature" error, both on Album 
and Artist objects. 
Sample code:

    lastfm = pylast.get_lastfm_network(api_key=API_KEY, api_secret=API_SECRET)
    obj    = lastfm.get_artist('Air')
    tags   = obj.get_tags()
    print tags

Leads to the following exception:

    Traceback (most recent call last):
      File "test_tag.py", line 15, in <module>
        tags   = obj.get_tags()
      File "/Users/rix0rrr/Documents/Dev/genre_tagger/server/pylast.py", line 1024, in get_tags
        doc = self._request(self.ws_prefix + '.getTags', False, params)
      File "/Users/rix0rrr/Documents/Dev/genre_tagger/server/pylast.py", line 969, in _request
        return _Request(self.network, method_name, params).execute(cacheable)
      File "/Users/rix0rrr/Documents/Dev/genre_tagger/server/pylast.py", line 812, in execute
        response = self._download_response()
      File "/Users/rix0rrr/Documents/Dev/genre_tagger/server/pylast.py", line 803, in _download_response
        self._check_response_for_errors(response_text)
      File "/Users/rix0rrr/Documents/Dev/genre_tagger/server/pylast.py", line 826, in 
_check_response_for_errors
        raise WSError(self.network, status, details)
    server.pylast.WSError: Invalid method signature supplied

Original issue reported on code.google.com by rix0...@gmail.com on 3 Apr 2010 at 2:28

GoogleCodeExporter commented 9 years ago
Nevermind, I just found out the getTags operation is not supposed to return all 
the object's tags, but a user's 
individual tags applied to that object, and then the error is probably due to 
the fact that I didn't supply a session 
key.

The error could be more helpful though, and I'm still stuck trying to retrieve 
all object tags... 

Original comment by rix0...@gmail.com on 3 Apr 2010 at 2:32

GoogleCodeExporter commented 9 years ago
Artist.getTags() gets the tags applied by an individual user to an artist on 
Last.fm.
If that is what you need you're to use call like this:

lastfm = pylast.get_lastfm_network(api_key=API_KEY, api_secret=API_SECRET,
username='username', password_hash=pylast.md5('password'))

That works fine to me. As I understand session key is generated by pylast 
itself.

If you need common artist's tags use Artist.get_top_tags().

Original comment by kl7....@gmail.com on 4 Apr 2010 at 5:20

GoogleCodeExporter commented 9 years ago

Original comment by amr.hassan on 5 Jan 2011 at 5:49