mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-22 23:25:35 +00:00
Use the correct format string for fetching files from twitter.
Per their docs https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/entities#photo_format
This commit is contained in:
parent
4cdb8f78cb
commit
644fe41a08
|
@ -94,7 +94,7 @@ proc createMediaRouter*(cfg: Config) =
|
||||||
url.insert(twimg)
|
url.insert(twimg)
|
||||||
if not url.startsWith(https):
|
if not url.startsWith(https):
|
||||||
url.insert(https)
|
url.insert(https)
|
||||||
url.add(":orig")
|
url.add("?name=orig")
|
||||||
|
|
||||||
let uri = parseUri(url)
|
let uri = parseUri(url)
|
||||||
cond isTwitterUrl(uri) == true
|
cond isTwitterUrl(uri) == true
|
||||||
|
|
|
@ -10,7 +10,7 @@ import general
|
||||||
proc getSmallPic(url: string): string =
|
proc getSmallPic(url: string): string =
|
||||||
result = url
|
result = url
|
||||||
if "?" notin url and not url.endsWith("placeholder.png"):
|
if "?" notin url and not url.endsWith("placeholder.png"):
|
||||||
result &= ":small"
|
result &= "?name=small"
|
||||||
result = getPicUrl(result)
|
result = getPicUrl(result)
|
||||||
|
|
||||||
proc renderMiniAvatar(user: User; prefs: Prefs): VNode =
|
proc renderMiniAvatar(user: User; prefs: Prefs): VNode =
|
||||||
|
@ -58,7 +58,7 @@ proc renderAlbum(tweet: Tweet): VNode =
|
||||||
let
|
let
|
||||||
named = "name=" in photo
|
named = "name=" in photo
|
||||||
orig = photo
|
orig = photo
|
||||||
small = if named: photo else: photo & ":small"
|
small = if named: photo else: photo & "?name=small"
|
||||||
a(href=getOrigPicUrl(orig), class="still-image", target="_blank"):
|
a(href=getOrigPicUrl(orig), class="still-image", target="_blank"):
|
||||||
genImg(small)
|
genImg(small)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue