Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram media saver bot

Bot receives messages with URLs, downloads media using yt-dlp and sends the files back to the user. Text messages from the bot appear only in case of errors (or when a file cannot be sent).

Supported use cases (depends on yt-dlp support):

  • Short video from TikTok / Instagram / Threads / YouTube Shorts and other sites.
  • Media that is visible only to logged‑in / age‑verified users (using cookies).
  • Audio tracks from Spotify / SoundCloud / YouTube Music converted to MP3 (where technically possible).

For age‑restricted or private videos that are visible only to logged‑in users, the bot can use a cookie file exported from your browser.

Run locally (without Docker)

  1. Install dependencies:
cd /home/dima/Work/var/PythonSaverBot
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. (Optional) Prepare cookies for age‑restricted/private media:
  • Install a browser extension like Get cookies.txt (or similar).
  • Log into the services you need (TikTok, YouTube, Instagram, etc.).
  • On any page of the corresponding site, export cookies to a file, for example cookies.txt.
  1. Export environment variables:
export TELEGRAM_BOT_TOKEN="123456:ABCDEF..."

# if you have a cookie file:
export YTDLP_COOKIE_FILE="/absolute/path/to/cookies.txt"
  1. Run the bot:
python bot.py

Run with Docker

  1. Build the image:
cd /home/dima/Work/var/PythonSaverBot
docker build -t tg-media-bot .
  1. Run the container:
docker run -d \
  --name tg-media-bot \
  -e TELEGRAM_BOT_TOKEN="123456:ABCDEF..." \
  -e YTDLP_COOKIE_FILE="/app/cookies.txt" \
  -v /absolute/host/path/cookies.txt:/app/cookies.txt:ro \
  tg-media-bot

The bot uses long polling and will automatically process new messages.

About

Telegram bot for downloading media content

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages