1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 19:22:32 +01:00

[twitter] fetch media from pinned tweets (#1203)

This commit is contained in:
Mike Fährmann 2020-12-29 16:27:43 +01:00
parent 2475176d99
commit 25074aec47
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -647,6 +647,7 @@ class TwitterAPI():
if params is None:
params = self.params.copy()
original_retweets = (self.extractor.retweets == "original")
pinned_tweet = True
while True:
cursor = tweet = None
@ -659,6 +660,12 @@ class TwitterAPI():
tweets = data["globalObjects"]["tweets"]
users = data["globalObjects"]["users"]
if pinned_tweet:
if "pinEntry" in instr[-1]:
tweet_ids.append(instr[-1]["pinEntry"]["entry"]["content"]
["item"]["content"]["tweet"]["id"])
pinned_tweet = False
# collect tweet IDs and cursor value
for entry in instr[0]["addEntries"]["entries"]:
entry_startswith = entry["entryId"].startswith