Safaa AI is a Telegram bot that isolates vocals from any song using AI. Drop a YouTube link or upload an MP3, and the bot handles the rest — no editing software, no manual work.
| 🎥 | Extract audio directly from YouTube links |
| 📤 | Or upload an audio file straight from Telegram |
| 🤖 | AI-powered vocal isolation using Demucs (htdemucs model) |
| 🧹 | Automatic cleanup of temporary files after every request |
| ⚡ | Fully async — handles multiple users concurrently |
- Python 3.9+
- FFmpeg installed and available on your system
PATH - A Telegram bot token from @BotFather
1. Clone the repo
git clone https://github.com/RamiDevX/Safaa-AI.git
cd Safaa-AI2. Create and activate a virtual environment
python -m venv .venv
# Windows
.venv\Scripts\Activate.ps1
# macOS/Linux
source .venv/bin/activate3. Install dependencies
pip install -r requirements.txt4. Configure environment variables
Create a .env file in the project root:
BOT_TOKEN=your_telegram_bot_token_here5. Run the bot
python bot.py| Command / Action | Result |
|---|---|
/start |
Shows a welcome message and instructions |
| Send a YouTube link | Bot downloads the audio and returns the isolated vocals |
| Upload an audio file (≤ 20 MB) | Same process, straight from your file |
Safaa-AI/
├── bot.py # Main bot logic
├── requirements.txt # Python dependencies
├── .env # Bot token (not committed)
├── .gitignore
└── bot_data/ # Runtime logs + temporary session files (auto-created)
Note
The first run downloads the htdemucs model weights (~80 MB), so the first request takes longer than usual.
Note
Videos longer than 30 minutes are skipped to avoid excessive resource usage — configurable via MAX_VIDEO_DURATION_SECONDS in bot.py.
Warning
Never commit your .env file or bot token to version control.