Metadata-Version: 2.4
Name: muget
Version: 4.0.2
Summary: YouTube Music downloader
Author: meikoy-chan
License-Expression: AGPL-3.0-or-later
Project-URL: Homepage, https://github.com/meikoy-chan/muget
Project-URL: Repository, https://github.com/meikoy-chan/muget
Keywords: youtube-music,music,playlist,downloader
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ytmusicapi==1.12.0
Requires-Dist: mutagen==1.48.0
Requires-Dist: yt-dlp==2026.6.9
Requires-Dist: yt-dlp-ejs==0.8.0
Dynamic: license-file

# MuGet

Download YouTube Music audio with metadata.

## Requirements

Before using MuGet, make sure the following tools are installed and available in your PATH:

* Python
* FFmpeg
* Deno

## Installation

```bash
pip install muget
```
## Configuration

The first time MuGet runs, it automatically creates a configuration file:

**• Linux:**

```text
~/muget.json
```

**• Windows:**

```text
C:\Users\<username>\muget.json
```

**• Default configuration:**

```json
    "audio_itag": "251",
    "output_directory": "YouTube Music",
    "delay_between_downloads": 1,
    "embed_cover": true,
    "skip_existing": true,
    "cookies_path": null,
    "po_token": null,
    "replaygain": false #Do not enable. It corrupts data.
```

Edit this file if you want to customize MuGet.

**• Configuration Options:**

| Option                    | Description                                             |
| ------------------------- | ------------------------------------------------------- |
| `audio_itag`              | Audio format to download.                               |
| `output_directory`        | Directory where downloaded music is stored.             |
| `delay_between_downloads` | Delay in seconds between downloads.                     |
| `embed_cover`             | Embed album artwork into audio files.                   |
| `skip_existing`           | Skip tracks that already exist.                         |
| `cookies_path`            | Path to a cookies.txt file for authenticated downloads. |
| `po_token`                | YouTube PO token used by yt-dlp.                        |
| `replaygain`              | Calculate ReplayGain tags after downloading albums.     |

**• Avaible Audio Formats:**

Available values for `audio_itag`:

| Itag  | Quality   | Codec  | Container | Account   |
| ----- | --------- | ------ | --------- | --------- |
| `249` | `48kbps`  | `opus` | `ogg`     | `free`    |
| `250` | `64kbps`  | `opus` | `ogg`     | `free`    | 
| `251` | `128kbps` | `opus` | `ogg`     | `free`    |
| `774` | `256kbps` | `opus` | `ogg`     | `premium` |
| `139` | `48kbps`  | `aac`  | `m4a`     | `free`    |
| `140` | `128kbps` | `aac`  | `m4a`     | `free`    |
| `141` | `256kbps` | `aac`  | `m4a`     | `premium` |

**• Examples:**

Specify the output directory (By default, it is saved in the directory where you are running the “muget” command):

 ```json
 "output_directory": "/home/user/Music",
 ```

Download AAC instead of Opus:

 ```json

 "audio_itag": "140",
 ```

Use browser cookies:

 ```json
 "cookies_path": "/home/user/cookies.txt",
 ```


## Usage

Run MuGet with the following command:

 ```bash
 muget "YOUR_URL"
 ```

**• Supported URL types:**

* Song
* Album
* Public playlist

**Songs that are not “Official” (regular YouTube videos) are excluded by this program.** To ensure you get valid links, use YouTube Music to search and enable the filter for songs or albums.

**• Examples:**

* Download a song:

    ```bash
    muget https://music.youtube.com/watch?v=EfjIqEGHmDI
    ```

* Download an album:

    ```bash
    muget https://music.youtube.com/playlist?list=OLAK5uy_keZv-_VVAJ8GQ3gEx9c3a3araWrT0En0Y
    ```
* Download an public playlist:

    ```bash
    muget https://music.youtube.com/playlist?list=RDCLAK5uy_mzE-hKfgQBgAY_ZN4O85nOo_H9U0P47Mc
    ```
## Output

Downloaded files are organized automatically:

```text
YouTube Music/
└── Album Artist/
    └── Album/
        ├── 01 - Song.opus
        ├── 02 - Song.opus
        └── 03 - Song.opus
```

## Metadata

MuGet automatically writes:

* Title
* Artist
* Album
* Album Artist
* Track Number
* Total Tracks
* Release Year
* Cover Art
* Lyrics (when available)
* Song Credits (when available)
    
