mirror of https://github.com/zedeus/nitter
Support tombstoned tweets in threads
This commit is contained in:
parent
b2580ed3ac
commit
892356e06d
|
@ -437,6 +437,18 @@ proc parseGraphConversation*(js: JsonNode; tweetId: string): Conversation =
|
|||
result.tweet = tweet
|
||||
else:
|
||||
result.before.content.add tweet
|
||||
elif entryId.startsWith("tombstone"):
|
||||
let id = entryId.getId()
|
||||
let tweet = Tweet(
|
||||
id: parseBiggestInt(id),
|
||||
available: false,
|
||||
text: e{"content", "itemContent"}.getTombstone
|
||||
)
|
||||
|
||||
if id == tweetId:
|
||||
result.tweet = tweet
|
||||
else:
|
||||
result.before.content.add tweet
|
||||
elif entryId.startsWith("conversationthread"):
|
||||
let (thread, self) = parseGraphThread(e)
|
||||
if self:
|
||||
|
|
|
@ -133,6 +133,9 @@ proc getTombstone*(js: JsonNode): string =
|
|||
result = js{"tombstoneInfo", "richText", "text"}.getStr
|
||||
result.removeSuffix(" Learn more")
|
||||
|
||||
if result.len == 0:
|
||||
result = js{"tombstoneInfo", "text"}.getStr
|
||||
|
||||
proc getMp4Resolution*(url: string): int =
|
||||
# parses the height out of a URL like this one:
|
||||
# https://video.twimg.com/ext_tw_video/<tweet-id>/pu/vid/720x1280/<random>.mp4
|
||||
|
|
Loading…
Reference in New Issue