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
parent 94c83f3811
commit e40c61a6ae

View File

@@ -364,7 +364,9 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string; v2=true): Conversati
if instructions.len == 0:
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
if entryId.startsWith("tweet"):
with tweetResult, e{"content", contentKey, resultKey, "result"}: