mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Add support for loading more tweet replies
This commit is contained in:
parent
14e544500d
commit
9038645bc1
9 changed files with 44 additions and 22 deletions
|
|
@ -3,7 +3,7 @@ import httpclient, asyncdispatch, strutils, uri
|
|||
import ".."/[types, parser]
|
||||
import utils, consts, media
|
||||
|
||||
proc getTweet*(username, id, agent: string): Future[Conversation] {.async.} =
|
||||
proc getTweet*(username, id, after, agent: string): Future[Conversation] {.async.} =
|
||||
let headers = newHttpHeaders({
|
||||
"Accept": jsonAccept,
|
||||
"Referer": $base,
|
||||
|
|
@ -11,17 +11,17 @@ proc getTweet*(username, id, agent: string): Future[Conversation] {.async.} =
|
|||
"X-Twitter-Active-User": "yes",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
"Accept-Language": lang,
|
||||
"pragma": "no-cache",
|
||||
"x-previous-page-name": "profile"
|
||||
"Pragma": "no-cache",
|
||||
"X-Previous-Page-Name": "profile"
|
||||
})
|
||||
|
||||
let
|
||||
url = base / username / tweetUrl / id
|
||||
url = base / username / tweetUrl / id ? {"max_position": after}
|
||||
html = await fetchHtml(url, headers)
|
||||
|
||||
if html == nil: return
|
||||
|
||||
result = parseConversation(html)
|
||||
result = parseConversation(html, after)
|
||||
|
||||
let
|
||||
vidsFut = getConversationVideos(result, agent)
|
||||
|
|
|
|||
Loading…
Reference in a new issue