1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-06 03:55:36 -05:00

Hide ads/promoted tweets

Fixes #1234
This commit is contained in:
Zed
2025-04-15 02:06:00 +01:00
parent 83b0f8b55a
commit 94c83f3811

View File

@@ -336,7 +336,7 @@ proc parseGraphThread(js: JsonNode): tuple[thread: Chain; self: bool] =
let cursor = t{"item", "content", "value"}
result.thread.cursor = cursor.getStr
result.thread.hasMore = true
elif "tweet" in entryId:
elif "tweet" in entryId and "promoted" notin entryId:
let
isLegacy = t{"item"}.hasKey("itemContent")
(contentKey, resultKey) = if isLegacy: ("itemContent", "tweet_results")
@@ -381,7 +381,7 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string; v2=true): Conversati
let (thread, self) = parseGraphThread(e)
if self:
result.after = thread
else:
elif thread.content.len > 0:
result.replies.content.add thread
elif entryId.startsWith("tombstone"):
let id = entryId.getId()