Skip to content

Commit

Permalink
[tumblr] fix avatar URLs for non-OAuth1.0 calls (closes #193)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Mar 17, 2019
1 parent 8c20443 commit fb14f80
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
# Changelog

## Unreleased

## 1.8.0 - 2019-03-15
### Added
- Support for:
Expand Down
3 changes: 3 additions & 0 deletions gallery_dl/extractor/tumblr.py
Expand Up @@ -334,6 +334,9 @@ def info(self, blog):

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"]
Expand Down
2 changes: 1 addition & 1 deletion gallery_dl/version.py
Expand Up @@ -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"

0 comments on commit fb14f80

Please sign in to comment.