1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[twitter] fix pinned Tweet extraction (#6102)

This commit is contained in:
Mike Fährmann 2024-08-29 08:53:48 +02:00
parent b46169cfd2
commit c51938b82b
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -1623,6 +1623,9 @@ class TwitterAPI():
entries = instr["entries"]
elif instr_type == "TimelineAddToModule":
entries = instr["moduleItems"]
elif instr_type == "TimelinePinEntry":
if pinned_tweet:
pinned_tweet = instr["entry"]
elif instr_type == "TimelineReplaceEntry":
entry = instr["entry"]
if entry["entryId"].startswith("cursor-bottom-"):
@ -1661,9 +1664,11 @@ class TwitterAPI():
tweet = None
if pinned_tweet:
pinned_tweet = False
if instructions[-1]["type"] == "TimelinePinEntry":
if isinstance(pinned_tweet, dict):
tweets.append(pinned_tweet)
elif instructions[-1]["type"] == "TimelinePinEntry":
tweets.append(instructions[-1]["entry"])
pinned_tweet = False
for entry in entries:
esw = entry["entryId"].startswith