xgate1 / pylast

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

Album.get_cover_image() AttributeError #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please type example code that produces the issue:

a.get_cover_image()

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pylast.py", line 1184, in get_cover_image
    return _extract_all(self._request("album.getInfo", cacheable = True), 'image
')[size]
  File "pylast.py", line 957, in _request
    return _Request(self.network, method_name, params).execute(cacheable)
  File "pylast.py", line 811, in execute
    response = self._download_response()
  File "pylast.py", line 781, in _download_response
    data.append('='.join((name, urllib.quote_plus(_string(self.params[name])))))

  File "pylast.py", line 3358, in _string
    return text.encode("utf-8")
AttributeError: 'Album' object has no attribute 'encode'

What version of pyLast is this?
0.4.20

Please provide any additional information below.

Original issue reported on code.google.com by ZackF...@gmail.com on 22 Dec 2009 at 12:55

GoogleCodeExporter commented 8 years ago
Try this code:

network = pylast.get_lastfm_network(API_KEY, API_SECRET)
album = network.get_album("radiohead", "ok computer")
print album.get_cover_image()

Original comment by amr.hassan on 22 Dec 2009 at 1:02