Normalize YouTube Shorts links to watch URLs

This commit is contained in:
Fisto
2026-09-17 13:34:10 +02:00
parent 52049bf186
commit 8c72def863
6 changed files with 197 additions and 8 deletions
+4 -1
View File
@@ -96,7 +96,10 @@ One SQLite file per scrape (`index.db`, `node:sqlite`).
slopbot backend could ask for it (one request; null otherwise). Indexes: `kind`, `posted_at`, and
`media_sources(message_id)`. The database is an index; the media
folder holds bytes. Every item carries its poster (`author_id`, `author_name`), the post time
(`posted_at`), and its dimensions (`width`, `height`, `aspect_ratio`). Embed rows also store
(`posted_at`), and its dimensions (`width`, `height`, `aspect_ratio`). `youtube.com/shorts/<id>`
links are stored as `watch?v=<id>` (extraction and a one-time `user_version` migration), because the
embedded player and View full need the watch form; a shorts row that collides with an already
indexed watch URL folds into it (preview/file fields merge, message links move over). Embed rows also store
Discord's `title` (YouTube and friends) plus `title_key`, the lowercased, punctuation-collapsed
form used by the title search: multi-word prefix tokens by default ("Ma Ca Ju" finds *Man who jumps
over car*), one phrase with the exact-match toggle, and rows without a title drop out while a