Find TimelineAddEntries in tweets response (#1251)

See https://github.com/zedeus/nitter/issues/1250. Sometimes the API gives us more results
and the tweets are no longer at index 0.
This commit is contained in:
Gabriel Simmer 2025-05-01 12:39:05 +01:00 committed by GitHub
commit e40c61a6ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -364,7 +364,9 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string; v2=true): Conversati
if instructions.len == 0: if instructions.len == 0:
return return
for e in instructions[0]{"entries"}: for i in instructions:
if i{"__typename"}.getStr == "TimelineAddEntries":
for e in i{"entries"}:
let entryId = e{"entryId"}.getStr let entryId = e{"entryId"}.getStr
if entryId.startsWith("tweet"): if entryId.startsWith("tweet"):
with tweetResult, e{"content", contentKey, resultKey, "result"}: with tweetResult, e{"content", contentKey, resultKey, "result"}: