1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-01-31 19:51:34 +01:00

[twitter] add 'user_likes' metadata field for liked tweets

i.e. the 'screen_name' of the user whose liked tweets get extracted.

Ideally this would replace 'user' or at least be in the same format,
but that would break backwards compatibility or be impossible/too
complicated thanks to API result differences.

(#1421)
This commit is contained in:
Mike Fährmann 2021-04-02 02:52:01 +02:00
parent 8d124a3766
commit fd858eed7b
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -339,6 +339,9 @@ class TwitterLikesExtractor(TwitterExtractor):
pattern = BASE_PATTERN + r"/(?!search)([^/?#]+)/likes(?!\w)"
test = ("https://twitter.com/supernaturepics/likes",)
def metadata(self):
return {"user_likes": self.user}
def tweets(self):
return TwitterAPI(self).timeline_favorites(self.user)