Resolve external embed previews and keep their real MIME types

This commit is contained in:
Fisto
2026-09-16 12:52:44 +02:00
parent 7fa6118b6f
commit 1b5fcfed2f
11 changed files with 313 additions and 41 deletions
+7
View File
@@ -40,6 +40,13 @@ mobile draft at 390px.
- [x] C11 preview caching: Discord-hosted image/GIF previews (WebP 320px, hash-addressed, 5 MiB
cap, one attempt) run after every walk in both modes. Live run `...-20260916090722`:
`previewed: 2`; thumbs served over `/api/media/<scrape>/<item>/thumb` (200).
- [x] C19 External embed previews and MIME fixes. Embeds with no thumbnail in Discord's data are
resolved via provider oEmbed/fxtwitter and an `og:image` fallback; preview bytes keep their
real extension (`preview_ext`), so JPEG thumbnails serve as `image/jpeg` instead of mislabeled
WebP (the browser "Content-Type image/webp is not supported" errors). The grid no longer uses
embed page URLs as media, and first-frame `<video>` is limited to playable direct files
(mp4/webm/m4v) with an on-error placeholder. Live: fxtwitter/vxReddit/TikTok previews cached;
7 jpg + 4 webp thumbs served with the right types.
- [x] C18 Video previews and the status row. Uploaded videos have no Discord thumbnails: the
grid renders a first-frame `<video>` for them, and downloads generate a poster frame with
ffmpeg into `thumbs/` (live: both video attachments in the test channel got posters). The