A Telegram downloader bot. Powered by YT-DLP https://github.com/sudospaes/rigel
Find a file
2025-06-03 09:30:00 +03:30
prisma Update: Read this commit description for details. 2025-04-13 15:49:12 +03:30
src Fixing a mistake I don't know why I made 2025-04-28 11:57:13 +03:30
.gitignore Better scripts and gitignore 2025-04-21 14:05:56 +03:30
bun.lock Update dependencies 2025-05-06 09:25:25 +03:30
LICENSE Initial commit 2025-04-10 00:13:22 +03:30
package.json Update dependencies 2025-05-06 09:25:25 +03:30
README.md Update README.md 2025-06-03 09:30:00 +03:30
tsconfig.json Enable noUnusedLocals, noUnusedParameters in tsconfig 2025-04-11 11:27:52 +03:30

Rigel, A cool downloader bot 🌠

A personal Telegram bot for downloading from various media. Powered by ytdlp 😉

This bot supports concurrency, meaning that if multiple users request the same content simultaneously, it downloads the file only once and sends it to all of them.

Supported media:

  • 📌 Pinterest (Video)
  • 📺 Youtube (Video / Audio)
  • 🎧 Youtube Music
  • 👯 Tiktok (Video)
  • 📸 Instagram (Video)
  • ☁️ SoundCloud
  • 🔊 Spotify

Admin's Commands

Command Example Description
/users /users Show allowed users
/add /add 12345667 <-- (user id) name <-- (a name) Add a user to can use bot
/remove /remove 12345667 <-- (user id) Remove a user to can't use bot
/clean /clean Delete all allowed users
/destroy /destroy Clearing the entire archive

Usage

Just send your media link to bot and get your content 😃. Of course, the admin needs to add users who are allowed to use the bot to the list of users using the commands mentioned.

Setup and deploy

  1. Install Bun, Ytdlp, ffmpeg and aria2.
  2. Install Docker and run aiogram/telegram-bot-api image as a container.
  3. Clone it this repo git clone https://github.com/sudospaes/rigel.git.
  4. Move to cloned directory.
  5. Run bun i to install dependencies.
  6. Create .env in the current directory and paste these in that.
ADMIN_ID="" # You can get it from @userinfobot.
ADMIN_UN="" # Your username without @ if you want.
BOT_TOKEN="" # Your bot token.
LOCAL_API="" # Your telegram-bot-api container address.
SPOTIFY_CLIENT_ID="" # Get this from developer.spotify.com.
SPOTIFY_CLIENT_SECRET="" # Get this from developer.spotify.com.
CAPTION="" # Bot messages caption.
  1. Create ytcookies.txt in the current directory and put your youtube cookies on that.
  2. Run bun run init --name first_init to initialize database for the first time.
  3. Run bun start
  4. Done! if everything is correct, you should see "Bot is running...".

How to update

  1. Stop bot
  2. Move to cloned directory.
  3. Run these commands:
git fetch origin
git merge origin/main
git restore bun.lock
git pull origin main
bun i
bun run init --name new_update

FAQ

How does the bot communicate with ytdlp ?

It executes ytdlp as a process and understands its output. Although not advanced, it is good for having a lightweight wrapper and not depending on additional packages.

Why we need local bot api ?

To bypass the limitations of regular bots on Telegram. Read This

Why we use Spotify developer console ?

Spotify uses a DRM to prevent crawling and ytdlp is not able to directly get its content. So using the official Spotify APIs we get the song name and its creator and using ytdlp I download that song from YouTube Music.

The reason I didn't use spotdl was that it is a separate core and had limited documentation and parameters for implementing the warpper.