From 78b1c24ee00522a546805c14597758609904c272 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 6 May 2023 20:09:33 -0500 Subject: [PATCH] card: sane defaults --- src/transmute.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transmute.ts b/src/transmute.ts index e67ea9c..08f6569 100644 --- a/src/transmute.ts +++ b/src/transmute.ts @@ -173,7 +173,7 @@ interface PreviewCard { async function unfurlCard(url: string): Promise { console.log(`Unfurling ${url}...`); try { - const result = await unfurl(url, { fetch }); + const result = await unfurl(url, { fetch, follow: 2, timeout: 1000, size: 1024 * 1024 }); return { type: result.oEmbed?.type || 'link', url: result.canonical_url || url, @@ -187,7 +187,7 @@ async function unfurlCard(url: string): Promise { html: result.oEmbed?.html || '', width: result.oEmbed?.width || 0, height: result.oEmbed?.height || 0, - image: result.oEmbed?.thumbnails?.[0].url || null, + image: result.oEmbed?.thumbnails?.[0].url || result.open_graph.images?.[0].url || null, embed_url: '', blurhash: null, };