#!/usr/bin/env python
import pylast
import os
API_KEY = ""
API_SECRET = ""
u_name = ""
p_hash = pylast.md5("")
lastfm = pylast.get_lastfm_network(api_key = API_KEY, api_secret = API_SECRET,
username = u_name, password_hash = p_hash)
Artists = os.listdir(".")
Artists.sort()
for ArtistName in Artists:
print ArtistName
Artist = lastfm.get_artist(ArtistName)
TopTags = Artist.get_top_tags()
#
Revision: 226
Reproduce:
Create a folder and cd into it. Then make folder Mötorhead or Ljå
Run the program from the first dir you created.
Output:
~/test$ ls
Enslaved Leaves' Eyes Ljå Lumsk Mötorhead
~/test$ ~/bin/pytest.py
Enslaved
Leaves' Eyes
Ljå
Traceback (most recent call last):
File "~/bin/pytest.py", line 17, in <module>
TopTags = Artist.get_top_tags()
File "/usr/lib/python2.6/pylast.py", line 1080, in get_top_tags
doc = self._request(self.ws_prefix + '.getTopTags', True)
File "/usr/lib/python2.6/pylast.py", line 967, in _request
return _Request(self.network, method_name, params).execute(cacheable)
File "/usr/lib/python2.6/pylast.py", line 719, in __init__
self.sign_it()
File "/usr/lib/python2.6/pylast.py", line 725, in sign_it
self.params['api_sig'] = self._get_signature()
File "/usr/lib/python2.6/pylast.py", line 738, in _get_signature
string += self.params[name]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 47:
ordinal not in range(128)
Original issue reported on code.google.com by nae...@gmail.com on 4 Oct 2010 at 8:21
Original issue reported on code.google.com by
nae...@gmail.com
on 4 Oct 2010 at 8:21