1
0
mirror of https://github.com/zedeus/nitter.git synced 2026-01-29 06:42:50 -05:00

Revert "Replace tweet endpoint with GraphQL"

This reverts commit 19adc658c3.
This commit is contained in:
Zed
2023-02-02 12:38:58 +01:00
parent 19adc658c3
commit 36c72f9860
7 changed files with 67 additions and 111 deletions

View File

@@ -133,6 +133,10 @@ proc getTombstone*(js: JsonNode): string =
result = js{"tombstoneInfo", "richText", "text"}.getStr
result.removeSuffix(" Learn more")
proc getSource*(js: JsonNode): string =
let src = js{"source"}.getStr
result = src.substr(src.find('>') + 1, src.rfind('<') - 1)
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