fedimbed.bluesky: fix cid for recordWithMedia (copypaste moment)

This commit is contained in:
Cynthia Foxwell 2024-11-09 11:18:02 -07:00
parent 8f732b49bf
commit ce341409fb

View file

@ -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",