mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-22 18:35:29 +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)
|
||||
if not url.startsWith(https):
|
||||
url.insert(https)
|
||||
url.add(":orig")
|
||||
url.add("?name=orig")
|
||||
|
||||
let uri = parseUri(url)
|
||||
cond isTwitterUrl(uri) == true
|
||||
|
|
|
@ -10,7 +10,7 @@ import general
|
|||
proc getSmallPic(url: string): string =
|
||||
result = url
|
||||
if "?" notin url and not url.endsWith("placeholder.png"):
|
||||
result &= ":small"
|
||||
result &= "?name=small"
|
||||
result = getPicUrl(result)
|
||||
|
||||
proc renderMiniAvatar(user: User; prefs: Prefs): VNode =
|
||||
|
@ -58,7 +58,7 @@ proc renderAlbum(tweet: Tweet): VNode =
|
|||
let
|
||||
named = "name=" in 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"):
|
||||
genImg(small)
|
||||
|
||||
|
|
Loading…
Reference in a new issue