A Cloudflare worker that embeds Discord videos that are larger than 50mb. Demo at embederator.gummi.workers.dev. Deploy your own at workers.dev.
The relevant route is /embed
. It takes two query parameters:
v
: The direct URL of the video to embed.t
: The "thumbnail" of the video (any image).
https://embederator.gummi.workers.dev/embed?v=https://cdn.discordapp.com/attachments/123/456.mp4&t=https://cdn.discordapp.com/attachments/123/456.jpg
npm install
npm run dev
npm run deploy
It simply sets the the following HTML metadata. The width and height don't matter, it just needs a value.
{
'og:image': thumbnail,
'og:type': 'video.other',
'og:video:url': video,
'og:video:width': '1280',
'og:video:height': '720',
}