A telegram bot that turns links into videos, so that you don't have to deal with opening the cancer that is instagram, reddit, etc. in your browser.
Send urls to @mp4ify_bot, or add it to a group. The bot will try to download the video, converting to mp4 if needed, and send it back to you if successful. Videos must be less than 50MB due to Telegram's bot API limits.
Start your message with /verbose to get detailed logs.
Note: x.com links are intentionally not supported by default, because I do not want to have anything to do with a site that promotes obvious evils such as fascism. If you want to use the bot for x.com, you can self-host it and remove the
--use-extractorsline from yt-dlp.conf. If you think there are other sites that I should block as well, please let me know (or just make a PR).
-
Prerequisites
- Git
- Docker
- A telegram app api_id and api_hash for running the local bot server, see https://core.telegram.org/api/obtaining_api_id
- At least one telegram bot token (using @BotFather), two if you want to run both a local dev bot (live code reloading) and a prod bot (from a stable source snapshot) at the same time.
Note that you do not need to install bun or any of the runtime deps locally! Just use the dev container instead.
-
Clone the repository:
git clone https://github.com/miridius/video-bot.git
cd video-bot- Create and fill in
.env.telegramand/or.env.prod(see.env.telegram.example):
cp .env.telegram.example .env.telegram- Create and fill in
.env.devand/or.env.prod(depending which bots you want to run) with your bot token(s) (see.env.example):
cp .env.example .env.dev
cp .env.example .env.prod- Start the bot(s) using one of the following commands:
# dev bot, mounts your whole working directory and restarts on code changes
# (alternatively, run ./dev.sh)
docker compose up dev bot-api -d
# prod bot, bakes in the source at build time and is not affected by code changes
# (alternatively, run ./prod.sh)
docker compose up prod bot-api -d
# both bots at the same time
docker compose up -d- To run other bun commands like
bun add fooorbun repl, you can start a shell in the dev container:
# (alternatively, run ./shell.sh)
$ docker compose exec dev bash
bun@61702048407c:/app$ bun repl
>