[tumblr] fix avatar URLs for non-OAuth1.0 calls (closes #193)

pull/199/head
Mike Fährmann 6 years ago
parent 8c20443839
commit fb14f80d62
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1,5 +1,7 @@
# Changelog
## Unreleased
## 1.8.0 - 2019-03-15
### Added
- Support for:

@ -334,6 +334,9 @@ class TumblrAPI(oauth.OAuth1API):
def avatar(self, blog, size="512"):
"""Retrieve a blog avatar"""
if self.api_key:
url_fmt = "https://api.tumblr.com/v2/blog/{}/avatar/{}?api_key={}"
return url_fmt.format(blog, size, self.api_key)
params = {"size": size}
data = self._call(blog, "avatar", params, allow_redirects=False)
return data["avatar_url"]

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
__version__ = "1.8.0"
__version__ = "1.8.1-dev"

Loading…
Cancel
Save