Skip to content

ALGOANHAF/MP3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Telegram YouTube MP3 Downloader Bot

A clean, fast, production-ready Telegram bot that converts YouTube videos into MP3.

Python Telegram Bot API GitHub Termux No aiogram

animated divider


✨ What it does

This bot works in private chats and groups, supports command-based usage + inline buttons, and shows a clean preview card (thumbnail, title, duration) before downloading.

✅ Built for Termux (Android) + Python 3.12+
✅ Lightweight dependencies
✅ No aiogram • No Rust dependency


✅ Features

  • Convert YouTube videos to MP3
  • Group command support with reply-style response
  • Private chat button-based download flow
  • Preview card before download:
    • Thumbnail image
    • Video title
    • Duration
  • Inline Download MP3 button
  • Clean temporary file handling
  • Fast + stable performance
  • Termux friendly

🚀 Usage

Group Chat Usage

Send this command in a group:

/download_mp3 https://youtu.be/VIDEO_ID

The bot replies directly to the command message with:

  • Thumbnail
  • Title
  • Duration
  • Download MP3 button

Private Chat Usage

  1. Start the bot
  2. Press Download MP3
  3. Send a YouTube video link
  4. Press Download MP3 from the preview

🖼️ Preview Images

Private Chat Preview

Private Chat Preview

📦 Requirements

  • Python 3.12+
  • ffmpeg
  • Telegram Bot Token

📱 Termux Installation (Android)

pkg update -y && pkg upgrade -y
pkg install -y python ffmpeg git

🧰 Python Package Installation

pip install -U pip
pip install pytelegrambotapi yt-dlp aiofiles

🧱 Project Setup

Clone the repository:

git clone https://github.com/algoanhaf/MP3.git
cd MP3

▶️ Run the Bot

python bot_mp3.py

Run in background (optional)

nohup python bot_mp3.py > bot.log 2>&1 &

🧠 Notes (so your bot doesn’t act goofy)

  • If downloads fail, confirm ffmpeg is installed and accessible in PATH.
  • For Termux, allow storage if you need local file access:
    termux-setup-storage
  • Keep temp files in a dedicated folder and clean up after sending.

footer

Made by @algoanhaf