[tumblr] fix avatar URLs for non-OAuth1.0 calls (closes #193)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
## 1.8.0 - 2019-03-15
|
## 1.8.0 - 2019-03-15
|
||||||
### Added
|
### Added
|
||||||
- Support for:
|
- Support for:
|
||||||
|
|||||||
@@ -334,6 +334,9 @@ class TumblrAPI(oauth.OAuth1API):
|
|||||||
|
|
||||||
def avatar(self, blog, size="512"):
|
def avatar(self, blog, size="512"):
|
||||||
"""Retrieve a blog avatar"""
|
"""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}
|
params = {"size": size}
|
||||||
data = self._call(blog, "avatar", params, allow_redirects=False)
|
data = self._call(blog, "avatar", params, allow_redirects=False)
|
||||||
return data["avatar_url"]
|
return data["avatar_url"]
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
__version__ = "1.8.0"
|
__version__ = "1.8.1-dev"
|
||||||
|
|||||||
Reference in New Issue
Block a user