Added parameter to retrieve higher resolution user avatars
This commit is contained in:
parent
41a3b96a0e
commit
0d98c3590f
|
@ -2409,12 +2409,19 @@ class User(_BaseObject, _Chartable):
|
||||||
return self._get_things(
|
return self._get_things(
|
||||||
"getTopTracks", "track", Track, params, cacheable)
|
"getTopTracks", "track", Track, params, cacheable)
|
||||||
|
|
||||||
def get_image(self):
|
def get_image(self, size=COVER_EXTRA_LARGE):
|
||||||
"""Returns the user's avatar."""
|
"""
|
||||||
|
Returns the user's avatar
|
||||||
|
size can be one of:
|
||||||
|
COVER_EXTRA_LARGE
|
||||||
|
COVER_LARGE
|
||||||
|
COVER_MEDIUM
|
||||||
|
COVER_SMALL
|
||||||
|
"""
|
||||||
|
|
||||||
doc = self._request(self.ws_prefix + ".getInfo", True)
|
doc = self._request(self.ws_prefix + ".getInfo", True)
|
||||||
|
|
||||||
return _extract(doc, "image")
|
return _extract_all(doc, "image")[size]
|
||||||
|
|
||||||
def get_url(self, domain_name=DOMAIN_ENGLISH):
|
def get_url(self, domain_name=DOMAIN_ENGLISH):
|
||||||
"""Returns the url of the user page on the network.
|
"""Returns the url of the user page on the network.
|
||||||
|
|
Loading…
Reference in a new issue