From d6b0fbc8ecb26717b165e06ee7d3ad5f34386bec Mon Sep 17 00:00:00 2001 From: Satya Ananda Date: Tue, 11 Feb 2025 15:52:20 +0700 Subject: [PATCH] api/url: extract loom video id from longer links (#832) Co-authored-by: jj --- api/src/processing/url.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/processing/url.js b/api/src/processing/url.js index f4a5c5b1..82299999 100644 --- a/api/src/processing/url.js +++ b/api/src/processing/url.js @@ -98,6 +98,14 @@ function aliasURL(url) { if (url.hostname === 'xhslink.com' && parts.length === 3) { url = new URL(`https://www.xiaohongshu.com/a/${parts[2]}`); } + break; + + case "loom": + const idPart = parts[parts.length - 1]; + if (idPart.length > 32) { + url.pathname = `/share/${idPart.slice(-32)}`; + } + break; } return url;