Cache embed thumbnails in download mode

This commit is contained in:
Fisto
2026-09-16 11:17:37 +02:00
parent 902646224f
commit 1fe204b91e
7 changed files with 161 additions and 47 deletions
+6 -8
View File
@@ -80,14 +80,12 @@ media-scrape/db/
- `download` fetches attachment bytes into `media/`, one file at a time, hash-addressed. Embed rows
are never download targets. The Media tab prefers the local file when one exists, so the archive
survives CDN URL expiry.
- Discord-hosted image and GIF previews are cached small (WebP, 320px) in `thumbs/` after every
walk, in both modes, so the grid does not depend on expiring CDN links. Third-party embed
thumbnails are never fetched.
- Third-party embeds are **never downloaded**: YouTube, Instagram, X, TikTok, and every other
embed stays a link with metadata.
- Discord-hosted image and sticker previews are cached small (`thumbs/`, WebP, via the CDN
resizer) in both modes, so the Media grid does not depend on expiring CDN links. Previews count
toward the storage limit.
- Third-party embeds are **never downloaded as media**: YouTube, Instagram, X, TikTok, and every
other embed stays a link. In `download` mode their thumbnail is cached (below); the video itself
is never fetched.
- Previews are cached small (WebP, 320px) in `thumbs/` after every walk. In both modes this covers
Discord-hosted images and GIFs; in `download` mode it also covers embed thumbnails, so the grid
does not depend on expiring CDN links. Previews count toward the storage limit.
- Discord attachment URLs are signed and expire in about a day. In `links` mode an expired URL is
refreshed by re-fetching its message; in `download` mode the bytes are caught before expiry.