1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-13 07:42:48 -05:00

Use old api to optimize photo rails

This commit is contained in:
Zed
2020-06-17 00:20:34 +02:00
parent 7e40af5611
commit 77da2e32c6
7 changed files with 37 additions and 40 deletions

View File

@@ -49,9 +49,12 @@ proc getMediaTimeline*(id: string; after=""): Future[Timeline] {.async.} =
let url = mediaTimeline / (id & ".json") ? genParams(cursor=after)
result = parseTimeline(await fetch(url), after)
proc getPhotoRail*(id: string): Future[PhotoRail] {.async.} =
let url = mediaTimeline / (id & ".json") ? genParams()
result = parsePhotoRail(await fetch(url))
proc getPhotoRail*(name: string): Future[PhotoRail] {.async.} =
let
ps = genParams({"screen_name": name, "trim_user": "true"},
count="18", ext=false)
url = photoRail ? ps
result = parsePhotoRail(await fetch(url, oldApi=true))
proc getSearch*[T](query: Query; after=""): Future[Result[T]] {.async.} =
when T is Profile: