mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[tumblr] fix 401 Unauthorized for likes when using api-key (#5994)
fixes regression introduced in 540eaa5a
This commit is contained in:
parent
9db361e4cd
commit
785e6f2911
@ -400,6 +400,9 @@ class TumblrAPI(oauth.OAuth1API):
|
||||
"""Retrieve liked posts"""
|
||||
endpoint = "/v2/blog/{}/likes".format(blog)
|
||||
params = {"limit": "50", "before": self.before}
|
||||
if self.api_key:
|
||||
params["api_key"] = self.api_key
|
||||
|
||||
while True:
|
||||
posts = self._call(endpoint, params)["liked_posts"]
|
||||
if not posts:
|
||||
|
@ -334,6 +334,14 @@ __tests__ = (
|
||||
"#count" : 1,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "http://mikf123.tumblr.com/likes",
|
||||
"#category": ("", "tumblr", "likes"),
|
||||
"#class" : tumblr.TumblrLikesExtractor,
|
||||
"#options" : {"api-secret": None},
|
||||
"#count" : 1,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.tumblr.com/blog/view/mikf123/likes",
|
||||
"#category": ("", "tumblr", "likes"),
|
||||
|
Loading…
Reference in New Issue
Block a user