From ce341409fbd76b06aa8c1c6a08874aa2eea64fe6 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 9 Nov 2024 11:18:02 -0700 Subject: [PATCH] fedimbed.bluesky: fix cid for recordWithMedia (copypaste moment) --- src/modules/fedimbed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/fedimbed.js b/src/modules/fedimbed.js index 0cd5f6e..4884fb2 100644 --- a/src/modules/fedimbed.js +++ b/src/modules/fedimbed.js @@ -166,7 +166,7 @@ async function blueskyQuoteEmbed(quote) { } else if (embed.media.$type === "app.bsky.embed.video#view") { const lookup = await fetch(`https://plc.directory/${quote.author.did}`).then((res) => res.json()); const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint; - const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${quote.author.did}&cid=${embed.cid}`; + const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${quote.author.did}&cid=${embed.media.cid}`; const contentType = await fetch(videoUrl, { method: "HEAD", @@ -283,7 +283,7 @@ async function bluesky(msg, url, spoiler = false) { } else if (post.embed.media.$type === "app.bsky.embed.video#view") { const lookup = await fetch(`https://plc.directory/${post.author.did}`).then((res) => res.json()); const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint; - const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${post.author.did}&cid=${post.embed.cid}`; + const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${post.author.did}&cid=${post.embed.media.cid}`; const contentType = await fetch(videoUrl, { method: "HEAD",