Skip to content

An intelligent, self-hosted audio assistant for Telegram. Delivers high-fidelity 320kbps MP3s with smart metadata and cover art, powered by a secure network tunneling layer for maximum reliability.

License

Notifications You must be signed in to change notification settings

SoroushImanian/HaveIT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎵 HaveIT

The Intelligent Music Gateway

Python Version License: MIT Telegram Bot API Network Layer

Universal Music Assistant • High-Fidelity Audio • Smart Metadata • Secure Routing


📖 Introduction

HaveIT is your personal, self-hosted Audio Assistant. Designed as a centralized hub for your music needs, HaveIT acts as an intelligent bridge between web streaming libraries and your personal collection.

Built on a modular and robust architecture, HaveIT integrates a secure network tunneling layer to ensure high-speed data transfer and consistent connectivity. Whether processing a soundtrack or a music stream, the assistant delivers crystal-clear 320kbps MP3s with embedded cover art and rich metadata directly to your chat interface.

✨ Features

  • 🧠 Smart Engine: Automatically identifies source URLs and optimizes the extraction process for the best results.
  • ❤️‍🩹 Autonomous Resilience: Actively monitors connectivity. If throttling or access issues are detected, the system automatically diagnoses and rotates the network route to resolve the issue instantly without user intervention.
  • 🌐 Enhanced Connectivity: Leverages Cloudflare Warp infrastructure to ensure stable, low-latency data streaming and maximum uptime.
  • 🎧 Audiophile Standard: Enforces a strict 320kbps bitrate encoding for a premium listening experience.
  • 🖼️ Intelligent Metadata: Automatically fetches, processes, and embeds high-resolution album art and ID3 tags.
  • 🛡️ Private Ecosystem: Operates exclusively within your defined ALLOWED_CHAT_IDS, ensuring resource privacy.
  • ⚡ Live Telemetry: Provides real-time feedback and progress bars for download and conversion tasks.
  • 🧹 Automated Maintenance: Features an auto-cleanup routine to manage temporary assets and maintain server hygiene.

🛠️ Prerequisites

To deploy your assistant, ensure your Linux environment (Ubuntu 20.04/22.04 recommended) meets the following requirements:

  • Python 3.10+
  • FFmpeg (Core media processing engine)
  • Git
  • Cloudflare Warp (Required for network routing layer)

1. Install System Dependencies

Update your system and install the necessary packages:

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

2. Configure Network Layer (Cloudflare Warp)

HaveIT relies on a modern network tunnel to handle data streams efficiently and securely. We utilize Cloudflare Warp as the underlying transport layer for optimal performance.

A) Install the Client:

# Add GPG Key
curl -fsSL [https://pkg.cloudflareclient.com/pubkey.gpg](https://pkg.cloudflareclient.com/pubkey.gpg) | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg

# Add Repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] [https://pkg.cloudflareclient.com/](https://pkg.cloudflareclient.com/) $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list

# Install Package
sudo apt-get update && sudo apt-get install cloudflare-warp

B) Initialize Proxy Interface (Port 3420): Configure the client to operate in proxy mode on port 3420 to route the assistant's traffic.

warp-cli registration new
warp-cli mode proxy
warp-cli proxy port 3420
warp-cli connect

C) Verify Network Status: Ensure the tunnel is active and routing traffic correctly:

curl -x socks5://127.0.0.1:3420 ifconfig.me
# Output should reflect the routed network IP.

🚀 Deployment

1. Clone the Repository

git clone [https://github.com/SoroushImanian/HaveIT.git](https://github.com/SoroushImanian/HaveIT.git)
cd HaveIT

2. Install Python Requirements

pip install -r requirements.txt

(Core libs: python-telegram-bot, yt-dlp, mutagen, requests)

3. Configuration

Open HaveIT.py and customize your assistant's settings:

# 1. Access Control: Add your numeric ID (Get it from @userinfobot)
ALLOWED_CHAT_IDS = [123456789, 987654321]

# 2. Network Routing: Match this with your Warp port (Step 2B)
PROXY_URL = 'socks5://127.0.0.1:3420'

🤖 Running as a Service (Recommended)

For a production-grade deployment, run HaveIT as a background system service.

  1. Create Service File:
sudo nano /etc/systemd/system/HaveIT.service
  1. Paste Configuration: (Replace YOUR_BOT_TOKEN_HERE with your actual API token)
[Unit]
Description=HaveIT Audio Assistant
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root/HaveIT
Environment="TELEGRAM_BOT_TOKEN=YOUR_BOT_TOKEN_HERE"
ExecStart=/usr/bin/python3 /root/HaveIT/HaveIT.py
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
  1. Activate the Service:
sudo systemctl daemon-reload
sudo systemctl enable HaveIT
sudo systemctl start HaveIT
  1. Monitor Status:
sudo systemctl status HaveIT

📜 License

This project is open-source and available under the MIT License.

“Power belongs to those who seek it”

Powered by SorBlack


About

An intelligent, self-hosted audio assistant for Telegram. Delivers high-fidelity 320kbps MP3s with smart metadata and cover art, powered by a secure network tunneling layer for maximum reliability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages