1
0
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:
Mike Fährmann 2024-08-12 09:09:59 +02:00
parent 9db361e4cd
commit 785e6f2911
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 11 additions and 0 deletions

View File

@ -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:

View File

@ -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"),