# Tunetti ๐ต
[](https://sonarqube.huitsinnevada.fi/dashboard?id=Tunetti)
A desktop YouTube Music player โ search, play, and manage your music without opening a browser. ๐ฅ๏ธ
> ### ๐ค A note about this project
>
> This project is **approximately 99% AI-generated code**. It was created by prompting large language models โ not by hand. The code works, but it may not follow every best practice you'd expect from hand-written software. Contributions, bug reports, and suggestions are very welcome! ๐
---
## โจ What can it do?
- **๐ถ YouTube Music search & playback** โ Find songs, albums, and artists right from the app.
- **๐ง Play music in the background** โ Keep listening while you work.
- **๐จ Good-looking interface** โ Dark theme with a modern, clean design.
- **๐ค Discord Rich Presence** โ Show your friends what you're listening to.
- **๐ Play history & stats** โ See your most-played tracks, listening trends, and daily counts.
- **โญ Favourites** โ Save songs you love and find them again instantly.
- **๐ Audio visualizer** โ A colorful spectrum display that moves with the music.
- **โฏ๏ธ Full playback controls** โ Play, pause, skip, seek, volume, loop, shuffle, and queue.
- **โ๏ธ Configurable** โ Toggle Discord RPC, visualizer, and more in settings.
- **๐พ Lightweight** โ Streams audio on demand; no big music library to store.
---
## ๐ What you'll need
- **Python 3.10 or newer**
- **Linux** with **PulseAudio** or **PipeWire** for sound
- **FFmpeg** installed and on your `PATH`
## ๐ Getting started
```bash
# Download the code
git clone https://git.huitsinnevada.fi/NikkeDoy/Tunetti.git
cd Tunetti
# Set up a virtual environment
python -m venv .venv
source .venv/bin/activate
# Install everything
pip install -r requirements.txt
```
> โ ๏ธ You might also need system packages like `libegl1` or `libxkbcommon0` โ your package manager will tell you what's missing.
### โถ๏ธ Running Tunetti
```bash
# Normal mode
python main.py
# Debug mode (see what's happening under the hood)
TUNETTI_VERBOSE=1 python main.py
```
On first launch, Tunetti creates `~/.config/tunetti/` and sets everything up for you.
### ๐ง Environment variables
| Variable | What it does |
|---|---|
| `TUNETTI_VERBOSE` | Set to `1`, `true`, or `yes` to see detailed debug logs. |
---
## ๐ How the code is organized
```
Tunetti/
โโโ main.py # App start & logging
โโโ gui.py # All the visual stuff (window, search bar, visualizer, stats, settings)
โโโ player.py # Audio playback, downloads, queue
โโโ config.py # Settings loader
โโโ music_db.py # History, favourites, stats database
โโโ discord_rpc.py # Discord integration
โโโ requirements.txt # List of Python packages needed
โโโ sonar-project.properties
โโโ .gitea/
โโโ workflows/
โโโ sonar.yaml # Automated code checks
```
## โ๏ธ Settings
Tunetti stores its settings in `~/.config/tunetti/config.json`. Here's what you can change:
| Setting | Default | What it does |
|---|---|---|
| `volume` | `50` | Playback volume (0โ100) |
| `max_history` | `5000` | Max number of plays to remember |
| `discord_rpc_enabled` | `true` | Show what you're listening to on Discord |
| `visualizer_enabled` | `true` | Show the audio spectrum visualizer |
| `db_path` | `~/.config/tunetti/music_history.db` | Where the database is stored |
## ๐ฆ What's under the hood
| Package | What it's used for |
|---|---|
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Downloads audio from YouTube |
| [ytmusicapi](https://github.com/sigma67/ytmusicapi) | Searches YouTube Music |
| [PySide6](https://pypi.org/project/PySide6/) | The graphical interface (Qt6) |
| [pypresence](https://github.com/qwertyquerty/pypresence) | Discord Rich Presence |
## ๐งช Quality checks
Code quality is analyzed automatically by SonarQube whenever changes are pushed.
## ๐ License
See [LICENSE](./LICENSE).