@@ -11,7 +11,7 @@ proc createEmbedRouter*(cfg: Config) =
|
||||
router embed:
|
||||
get "/i/videos/tweet/@id":
|
||||
let tweet = await getGraphTweetResult(@"id")
|
||||
if tweet == nil or tweet.video.isNone:
|
||||
if tweet == nil or not tweet.hasVideos:
|
||||
resp Http404
|
||||
|
||||
resp renderVideoEmbed(tweet, cfg, request)
|
||||
|
||||
+10
-6
@@ -44,15 +44,19 @@ proc createStatusRouter*(cfg: Config) =
|
||||
desc = conv.tweet.text
|
||||
|
||||
var
|
||||
images = conv.tweet.photos.mapIt(it.url)
|
||||
images = conv.tweet.getPhotos.mapIt(it.url)
|
||||
video = ""
|
||||
|
||||
if conv.tweet.video.isSome():
|
||||
images = @[get(conv.tweet.video).thumb]
|
||||
let
|
||||
firstMediaKind = if conv.tweet.media.len > 0: conv.tweet.media[0].kind
|
||||
else: photoMedia
|
||||
|
||||
if firstMediaKind == videoMedia:
|
||||
images = @[conv.tweet.media[0].getThumb]
|
||||
video = getVideoEmbed(cfg, conv.tweet.id)
|
||||
elif conv.tweet.gif.isSome():
|
||||
images = @[get(conv.tweet.gif).thumb]
|
||||
video = getPicUrl(get(conv.tweet.gif).url)
|
||||
elif firstMediaKind == gifMedia:
|
||||
images = @[conv.tweet.media[0].getThumb]
|
||||
video = getPicUrl(conv.tweet.media[0].gif.url)
|
||||
elif conv.tweet.card.isSome():
|
||||
let card = conv.tweet.card.get()
|
||||
if card.image.len > 0:
|
||||
|
||||
Reference in New Issue
Block a user