Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dustinrouillard/tiktok-embeds

Generates OpenGraph meta tags and gets the video file for Tiktoks from their share urls
https://github.com/dustinrouillard/tiktok-embeds

discord embeds tiktok

Last synced: about 2 months ago
JSON representation

Generates OpenGraph meta tags and gets the video file for Tiktoks from their share urls

Awesome Lists containing this project

README

        

# TikTok Share Embeds

This generates an OpenGraph embed for a tiktok from the following url formats

- `https://vm.tiktok.com/ZMRjsP94a`
- `https://tiktok.com/@momma_mandy_plus7/video/6992363023767850246`

Right now the embeds are confirmed working in Discord, and Telegram.

Runs in Cloudflare Workers, deployed with Wrangler, makes it snappy.

## Link usage

Going to the direct link will return the video

This link will return the metatags for the discord embed if the useragent contains Discord, then within the meta tags the url for the video is the following (which is required to have .mp4 at the end and used to return the video even if discord's user agent)

## Demo

![Discord Usage GIF](https://files.dstn.to/2c0f5c0bec98589e.gif)

This is my bot detecting that a tiktok link was sent and just sending a message with the link using the worker host to auto embed it.

The repo for this bot is [here](https://dstn.to/tt-discord-embeds) if you'd like to run it yourself.