Metadata-Version: 2.4
Name: musicmandu
Version: 1.0.0
Summary: A production-grade YouTube music downloader CLI
Author: Milan Prajapati
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Requires-Dist: yt-dlp>=2023.0.0
Requires-Dist: ffmpeg-downloader>=0.1.0

# 🎵 musicmandu

`musicmandu` is a production-grade, zero-configuration command-line interface (CLI) tool written in Python. It allows users to seamlessly download high-quality audio from YouTube videos and automatically process them into fully tagged, album-art-embedded MP3 files.

---

## ✨ Features

- **Zero Manual Dependencies:** Automatically detects, downloads, and caches the correct system-specific FFmpeg binaries at runtime—even when Windows user paths contain spaces.
- **High-Quality Audio:** Downloads the best available audio stream and converts it into a clean 192 kbps MP3 file.
- **Rich Metadata Integration:** Automatically extracts and embeds metadata such as the title and creator, then downloads and embeds the video's high-resolution thumbnail as album art.
- **Sleek Visual Feedback:** Uses `Rich` console components to replace noisy console output with clean status spinners and styled messages.

---

## 🚀 Installation & Prerequisites

`musicmandu` runs on **Windows, macOS, and Linux**.

### 1. Requirements

- Python 3.8 or later

### 2. Set Up the Project

Clone or navigate to the project directory, then install the required Python packages:

```bash
pip install typer rich yt-dlp ffmpeg-downloader
```

---

## 🛠 Usage & Commands

Run the CLI using standard Python execution syntax:

```bash
python main.py [COMMAND] [ARGUMENTS] [FLAGS]
```

### 1. Greet Users (`greet`)

Test the CLI setup or display a custom greeting.

```bash
# Standard greeting
python main.py greet Milan

# Formal greeting
python main.py greet "Mr. Wayne" --formal
```

### 2. Download Tracks (`download`)

Download audio and save a formatted MP3 file in the current working directory.

```bash
python main.py download "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
```

### 3. View Built-in Help

Display automatically generated command descriptions, arguments, and flags.

```bash
python main.py --help
python main.py download --help
```

---

## ⚙️ Architecture & Under the Hood

The application relies on three core frameworks to provide a seamless user experience:

- **Typer:** Powers command parsing, argument handling, flags, and dynamically generated help screens.
- **Rich:** Manages styled terminal output, layout, and responsive loading indicators.
- **yt-dlp and ffmpeg-downloader:** Handle the download and processing pipeline, including metadata extraction, high-bitrate audio retrieval, thumbnail downloading, and FFmpeg-based MP3 conversion.

### Runtime Dependency Sandbox

When the `download` command is invoked, the application runs a gatekeeper function named `ensure_ffmpeg_installed`.

If a valid FFmpeg installation cannot be found in the system path, the application downloads and caches a platform-specific FFmpeg binary. It then maps the binary into the current process environment without modifying the user's global system configuration.

---

## 📝 License

Distributed under the MIT License. See `LICENSE` for more information.

---

## 💡 Project Idea

A useful next feature would be a download history log that records previously downloaded songs.
