mirror of
https://github.com/zedeus/nitter.git
synced 2026-04-23 22:35:53 -04:00
Use media endpoint for profile media tab
This bypasses "search" rate limits. It now includes media beyond images and videos (eg. YouTube links are "media"), but the old behaviour can be restored by clicking search, then filtering "Media" and excluding retweets and replies.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import httpclient, asyncdispatch, htmlparser
|
||||
import strutils, json, xmltree, uri
|
||||
|
||||
import ../types
|
||||
import consts
|
||||
|
||||
proc genHeaders*(headers: openArray[tuple[key: string, val: string]];
|
||||
@@ -52,3 +53,11 @@ proc fetchJson*(url: Uri; headers: HttpHeaders): Future[JsonNode] {.async.} =
|
||||
result = parseJson(resp)
|
||||
except:
|
||||
return nil
|
||||
|
||||
proc getLastId*(tweets: Result[Tweet]): string =
|
||||
if tweets.content.len == 0: return
|
||||
let last = tweets.content[^1]
|
||||
if last.retweet.isNone:
|
||||
$last.id
|
||||
else:
|
||||
$(get(last.retweet).id)
|
||||
|
||||
Reference in New Issue
Block a user