このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
Nitter-mod/src/routes/embed.nim

16 行
423 B
Nim
Raw 通常表示 履歴

2021-12-27 10:37:38 +09:00
# SPDX-License-Identifier: AGPL-3.0-only
2021-12-20 11:11:12 +09:00
import asyncdispatch, strutils, options
2019-12-06 23:15:56 +09:00
import jester
2020-06-01 09:22:56 +09:00
import ".."/[types, api], ../views/embed
2019-12-06 23:15:56 +09:00
2021-12-20 11:11:12 +09:00
export api, embed
2019-12-06 23:15:56 +09:00
proc createEmbedRouter*(cfg: Config) =
router embed:
get "/i/videos/tweet/@id":
2020-06-01 09:22:56 +09:00
let convo = await getTweet(@"id")
if convo == nil or convo.tweet == nil or convo.tweet.video.isNone:
resp Http404
resp renderVideoEmbed(cfg, convo.tweet)