Skip to content

Repository files navigation

🎬 Video Trimmer Bot

A powerful Telegram bot built with Hydrogram and FFmpeg to trim, edit, and manage your video files with native Telegram colors and high precision.

🚀 Features

  • ✂️ Advanced Trimming: Supports single cuts and multi-segment splitting.
  • 🎯 Multi-Format Support: Parse timestamps in ss:ss, HH:MM:SS, or 30s from 01:00 formats.
  • ⏩ Speed Control: Adjust video speed from 0.5x to 2.0x with audio sync.
  • 📉 Compression: Reduce file size using CRF-based encoding (Low, Medium, High).
  • 🎵 Audio Extraction: Extract high-quality MP3 from any video.
  • 📱 WhatsApp Status Splitter: Automatically split long videos into 30s segments.
  • 🎨 Native UI: Uses modern Telegram native colored buttons and expandable blockquotes.
  • ⚡ High Performance: Multi-threaded processing with real-time progress bars.
  • ⚙️ Admin Controls: Manage file size limits and view logs via owner commands.

🛠️ VPS Deployment Guide

1. Update & Install Dependencies

First, update your system and install FFmpeg:

sudo apt update && sudo apt upgrade -y
sudo apt install ffmpeg python3-pip git -y

2. Clone the Repository

git clone <your-repo-url>
cd <repo-folder>

3. Install Python Packages

pip3 install -r requirements.txt

4. Configuration

Edit config.py and add your credentials:

5. Run the Bot

To run the bot normally:

python3 bot.py

🔄 How to Restart & Manage (VPS)

To keep the bot running 24/7 even after you close the terminal, use PM2 or Screen.

Using PM2 (Recommended)

  1. Install PM2: sudo npm install -g pm2
  2. Start the bot: pm2 start bot.py --name "video-bot" --interpreter python3
  3. Restart: pm2 restart video-bot
  4. Stop: pm2 stop video-bot
  5. Logs: pm2 logs video-bot

Using Screen

  1. Start a session: screen -S bot
  2. Run the bot: python3 bot.py
  3. Detach: Press Ctrl+A then D.
  4. Restart:
    • Reattach: screen -r bot
    • Stop with Ctrl+C, then run python3 bot.py again.

⚠️ Troubleshooting: "sqlite3.OperationalError: disk I/O error"

If you see this error on your VPS, it usually means the bot cannot write to the session file. Follow these steps:

  1. Check Disk Space: Run df -h. If your disk is 100% full, the bot will crash.
  2. Check Permissions: Ensure the bot has permission to write in the folder:
    chmod -R 755 .
  3. Delete Corrupt Session: Sometimes the session file gets corrupted during a crash.
    rm video_processor_bot.session*
    Then restart the bot and log in again.
  4. Docker/Filesystem Issues: If using Docker, ensure the volume has write permissions.

👨‍💻 Developer

Developed with ❤️ by @Unrated_Coder.

About

A powerful Telegram bot built with Hydrogram and FFmpeg to trim, edit, and manage your video files with native Telegram colors and high precision.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages