A Telegram bot that converts social media links into playable embeds or native videos directly in chat.
Live at: https://t.me/embedthat_bot
| Platform | Behavior |
|---|---|
| YouTube | Downloads and uploads video natively (up to 50 MB, split into parts if needed) |
| Rewrites link to ddinstagram.com proxy | |
| TikTok | Rewrites link to vxtiktok.com proxy |
| Twitter / X | Rewrites link to fxtwitter.com / fixupx.com |
- Python 3.12
- uv
- FFmpeg
- Node.js +
vot-cli(npm install -g vot-cli) — for YouTube audio translation - Redis
-
Clone the repo and install dependencies:
uv sync
-
Copy
.env.distto.envand fill in the required values:cp .env.dist .env
| Variable | Required | Description |
|---|---|---|
BOT_TOKEN |
Yes | Telegram bot token from @BotFather |
DUMP_CHAT_ID |
Yes | Chat ID where videos are temporarily sent to obtain Telegram file_ids for caching |
REDIS_URL |
No | Redis connection string (default: redis://redis) |
LOGLEVEL |
No | Log level (default: INFO) |
TZ |
No | Timezone for log timestamps (default: Asia/Almaty) |
FEED_CHANNEL_ID |
No | Channel to mirror processed links to |
ADMIN_CHAT_ID |
No | Admin chat for error notifications |
Locally (requires Redis running separately):
uv run main.pyWith Docker Compose (includes Redis):
docker compose up -dBuild Docker image:
docker build -t metheoryt/embedthat:latest .- User sends a social media link.
bot/handlers.pydetects theLinkOriginand routes accordingly.- Instagram/TikTok/Twitter links are rewritten to embed-friendly proxy domains and sent back.
- YouTube links go through a full pipeline:
- Best quality stream within Telegram's 50 MB limit is selected
- Video and audio are downloaded separately and merged with FFmpeg
- If the result exceeds 50 MB, it is split into up to 10 parts
- Optionally, audio is translated: language is detected via Whisper, translated via
vot-cli, and mixed with the original (quieted)
- Processed YouTube
file_ids are cached in Redis — repeat requests are served instantly without re-downloading.