Skip to content

Latest commit

 

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ebany kruzhok bot

Python Telegram yt-dlp FFmpeg

Read this in other languages: click

This Telegram bot is designed to convert media files and TikTok links into native Telegram formats (Video Notes and Voice Messages).

The bot automatically downloads TikTok videos without watermarks and processes files uploaded by users.

Features

TikTok Downloader:

  • Accepts TikTok links.
  • Offers a choice: convert to Video Note (circle) or Voice Message.

Video Conversion:

  • Converts standard video files (.mp4, etc.) into circular Video Notes.
  • Automatically crops video to a 1:1 aspect ratio (center) and resizes to 640x640.

Audio Conversion:

  • Converts audio files (.mp3, etc.) into Voice Messages (Opus codec). Logging:
  • Maintains detailed logs with date-based rotation in the logs/ directory.

Auto-Restart:

  • Built-in protection against crashes and network errors.

Requirements

To run the bot, you need:

  1. Python 3.8+
  2. FFmpeg (system-level) — Critical for media processing.

Installing FFmpeg:

Ubuntu/Debian:

sudo apt update && sudo apt upgrade && sudo apt install ffmpeg

Windows:

  • Method 1 (Recommended): Open a terminal (PowerShell or CMD) and run:
winget install Gyan.FFmpeg

⚠️ "winget" command not found? > If you are using an older version of Windows 10 and the command is missing, download and install the App Installer from the official GitHub releases (look for the file ending in .msixbundle).

  • Method 2 (Manual): Download the archive from the official repository, unzip it, and add the path to the bin folder to your system environment variables (PATH).
C:\ffmpeg\bin

MacOS:

brew install ffmpeg

Installation & Usage

1. Clone the repository

git clone https://github.com/Vovan999222/ebany_kruzhok_bot.git

cd ebany_kruzhok_bot

2. Create a virtual environment (Recommended)

python -m venv venv

Windows:

venv\Scripts\activate

Linux/Mac:

source venv/bin/activate

3. Install dependencies

You can install the libraries manually:

pip install aiogram imageio-ffmpeg ffmpeg-python yt-dlp

Or use the requirements.txt file and install it via:

pip install -r requirements.txt

4. Configuration

Open the config.py file and find the following line:

TOKEN = ""  # Paste your token from @BotFather here

Insert your bot token inside the quotes.

5. Run the bot

python bot.py

Technical Details

  • Limits: The bot processes files up to 50 MB.
  • Video: Encoded in H.264, preset veryfast, CRF 28 (optimized for Telegram).
  • Audio: Encoded in Opus, 48kHz (standard for Telegram voice messages).

License

This project is distributed under the MIT License

About

Telegram bot on Python (aiogram) to download TikToks and convert media into Video Notes (кружочки) and Voice Messages using FFmpeg.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages